fix(commands): register VimLeavePre to call stop_all
Problem: spawned compiler processes and watching autocmds were never cleaned up when Neovim exited, leaving orphaned processes running. Solution: register a VimLeavePre autocmd in commands setup that calls compiler.stop_all(), which kills active processes, unwatches all buffers, and stops the reload server.
This commit is contained in:
parent
75b855438a
commit
9d4f2e77cc
2 changed files with 19 additions and 0 deletions
|
|
@ -57,6 +57,12 @@ function M.setup()
|
|||
end,
|
||||
desc = 'Toggle, compile, clean, open, or check status of document preview',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('VimLeavePre', {
|
||||
callback = function()
|
||||
require('preview.compiler').stop_all()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue