Problem: `:e` (edit/reload) fires `BufUnload`, which tears down the entire preview — process, watchers, and viewer — even though the user is just reloading the current buffer. Solution: Switch the cleanup autocmd from `BufUnload` to `BufDelete`, which only fires on `:bdelete` and `:bwipeout`. Guard `nvim_del_autocmd` calls with `pcall` in cleanup paths since buffer-local autocmds may already be gone when the buffer is wiped before `stop_watching` runs. Closes #57 |
||
|---|---|---|
| .. | ||
| commands.lua | ||
| compiler.lua | ||
| diagnostic.lua | ||
| health.lua | ||
| init.lua | ||
| log.lua | ||
| presets.lua | ||
| reload.lua | ||