docs: document PreviewWatchingStopped event and update SyncTeX recipes
Problem: the new `PreviewWatchingStopped` event was undocumented, and the SyncTeX recipes never cleared `synctex_pdf` on watch stop. Solution: add the event to the events section and update the shared SyncTeX setup block to clear `synctex_pdf[bufnr]` on stop.
This commit is contained in:
parent
199ccf030c
commit
85dfdeacf7
1 changed files with 9 additions and 0 deletions
|
|
@ -293,6 +293,9 @@ preview.nvim fires User autocmds with structured data:
|
||||||
`PreviewCompileFailed` Compilation failed (non-zero exit).
|
`PreviewCompileFailed` Compilation failed (non-zero exit).
|
||||||
data: `{ bufnr, provider, code, stderr }`
|
data: `{ bufnr, provider, code, stderr }`
|
||||||
|
|
||||||
|
`PreviewWatchingStopped` Watching stopped (toggle off or buffer delete).
|
||||||
|
data: `{ bufnr, provider }`
|
||||||
|
|
||||||
Example: >lua
|
Example: >lua
|
||||||
vim.api.nvim_create_autocmd('User', {
|
vim.api.nvim_create_autocmd('User', {
|
||||||
pattern = 'PreviewCompileSuccess',
|
pattern = 'PreviewCompileSuccess',
|
||||||
|
|
@ -354,6 +357,12 @@ The following configs leverage the below basic setup: ~
|
||||||
synctex_pdf[args.data.bufnr] = args.data.output
|
synctex_pdf[args.data.bufnr] = args.data.output
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
vim.api.nvim_create_autocmd('User', {
|
||||||
|
pattern = 'PreviewWatchingStopped',
|
||||||
|
callback = function(args)
|
||||||
|
synctex_pdf[args.data.bufnr] = nil
|
||||||
|
end,
|
||||||
|
})
|
||||||
<
|
<
|
||||||
|
|
||||||
The recipes below bind `<leader>s` for forward search. To scroll the PDF
|
The recipes below bind `<leader>s` for forward search. To scroll the PDF
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue