fix(compiler): do not auto-open on one-shot compile
Problem: auto-open fired on :Preview compile, which is a one-shot build. Users compiling to check for errors or rebuild with the viewer already open got an unexpected browser/viewer window. Solution: gate auto-open on not opts.oneshot so it only fires during toggle/watch mode, where opening the viewer on first compile is the intended behaviour.
This commit is contained in:
parent
a2ef9a828f
commit
454030ad78
1 changed files with 2 additions and 0 deletions
|
|
@ -162,6 +162,7 @@ function M.compile(bufnr, name, provider, ctx, opts)
|
|||
|
||||
if
|
||||
provider.open
|
||||
and not opts.oneshot
|
||||
and not opened[bufnr]
|
||||
and output_file ~= ''
|
||||
and vim.uv.fs_stat(output_file)
|
||||
|
|
@ -240,6 +241,7 @@ function M.compile(bufnr, name, provider, ctx, opts)
|
|||
end
|
||||
if
|
||||
provider.open
|
||||
and not opts.oneshot
|
||||
and not opened[bufnr]
|
||||
and output_file ~= ''
|
||||
and vim.uv.fs_stat(output_file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue