Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
c12891f7ea
style(compiler): reformat long condition for stylua 2026-03-04 00:20:10 -05:00
Barrett Ruth
88dc47b643
Merge branch 'main' into fix/compiler-longrunning-open 2026-03-04 00:17:17 -05:00
Barrett Ruth
a5ebccc292
Merge branch 'main' into fix/compiler-longrunning-open 2026-03-03 18:00:06 -05:00
02958158c0
fix(compiler): check output exists before opening from long-running process
Problem: for long-running processes (typst watch), M.compile() calls
the opener immediately after vim.system() returns, before the process
has produced any output. On first run the output file does not exist
yet, so the opener is called on a nonexistent path.

Solution: guard the open block with vim.uv.fs_stat so it only fires
if the output file already exists at spawn time.
2026-03-03 17:50:36 -05:00

View file

@ -147,7 +147,12 @@ function M.compile(bufnr, name, provider, ctx)
end)
)
if provider.open and not opened[bufnr] and output_file ~= '' then
if
provider.open
and not opened[bufnr]
and output_file ~= ''
and vim.uv.fs_stat(output_file)
then
if provider.open == true then
vim.ui.open(output_file)
elseif type(provider.open) == 'table' then