preview.nvim/lua
Barrett Ruth 272153a158
fix(compiler): use BufDelete instead of BufUnload for cleanup (#59)
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
2026-03-12 16:52:26 -04:00
..
preview fix(compiler): use BufDelete instead of BufUnload for cleanup (#59) 2026-03-12 16:52:26 -04:00