fix(compiler): preserve viewer_open when viewer process exits
Problem: when `open` is a custom command like `sioyek --instance-name`, the process exits immediately after delegating to the running instance. The exit callback reset `viewer_open`, causing every recompile to reopen the viewer and toggle to reopen instead of stopping. Solution: stop clearing `viewer_open` in the `do_open` exit callback. The flag now persists for the watch session and is only reset by `stop_watching`.
This commit is contained in:
parent
f185ae78f7
commit
08f0b037e0
1 changed files with 1 additions and 2 deletions
|
|
@ -135,9 +135,8 @@ local function do_open(bufnr, output_file, open_config)
|
||||||
vim.schedule_wrap(function()
|
vim.schedule_wrap(function()
|
||||||
local s = state[bufnr]
|
local s = state[bufnr]
|
||||||
if s and s.viewer == proc then
|
if s and s.viewer == proc then
|
||||||
log.dbg('viewer exited for buffer %d, resetting viewer_open', bufnr)
|
log.dbg('viewer exited for buffer %d', bufnr)
|
||||||
s.viewer = nil
|
s.viewer = nil
|
||||||
s.viewer_open = nil
|
|
||||||
else
|
else
|
||||||
log.dbg('viewer exited for buffer %d (stale proc, ignoring)', bufnr)
|
log.dbg('viewer exited for buffer %d (stale proc, ignoring)', bufnr)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue