mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
fix(treesitter): validate window before updating preview highlights
This commit is contained in:
committed by
Lewis Russell
parent
fec51229c4
commit
2bf3e82676
@ -560,7 +560,9 @@ function M.preview_query()
|
|||||||
buffer = query_buf,
|
buffer = query_buf,
|
||||||
desc = 'Update query previewer highlights when the cursor moves',
|
desc = 'Update query previewer highlights when the cursor moves',
|
||||||
callback = function()
|
callback = function()
|
||||||
|
if api.nvim_win_is_valid(win) then
|
||||||
update_preview_highlights(query_win, win)
|
update_preview_highlights(query_win, win)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
api.nvim_create_autocmd('BufLeave', {
|
api.nvim_create_autocmd('BufLeave', {
|
||||||
|
Reference in New Issue
Block a user