feat(compiler): fire PreviewWatchingStopped user event

Problem: there was no way for user config to react when preview watching
stops, e.g. to clean up forward-search state for SyncTeX.

Solution: fire a `PreviewWatchingStopped` user autocmd from
`stop_watching` with `bufnr` and `provider` in the event data.
This commit is contained in:
Barrett Ruth 2026-03-15 13:34:44 -04:00
parent 08f0b037e0
commit 199ccf030c
Signed by: barrett
GPG key ID: A6C96C9349D2FC81

View file

@ -196,6 +196,10 @@ local function stop_watching(bufnr, s)
s.debounce:close()
s.debounce = nil
end
vim.api.nvim_exec_autocmds('User', {
pattern = 'PreviewWatchingStopped',
data = { bufnr = bufnr, provider = s.provider },
})
end
---@param bufnr integer