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:
parent
08f0b037e0
commit
199ccf030c
1 changed files with 4 additions and 0 deletions
|
|
@ -196,6 +196,10 @@ local function stop_watching(bufnr, s)
|
||||||
s.debounce:close()
|
s.debounce:close()
|
||||||
s.debounce = nil
|
s.debounce = nil
|
||||||
end
|
end
|
||||||
|
vim.api.nvim_exec_autocmds('User', {
|
||||||
|
pattern = 'PreviewWatchingStopped',
|
||||||
|
data = { bufnr = bufnr, provider = s.provider },
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param bufnr integer
|
---@param bufnr integer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue