commit 2bf3e82676d5caf674cf5ed1eb9677376d9cfa35
parent fec51229c4a073f83778aba699f6f7fc7d3df027
Author: Maria José Solano <majosolano99@gmail.com>
Date: Sat, 26 Aug 2023 13:24:29 -0700
fix(treesitter): validate window before updating preview highlights
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua
@@ -560,7 +560,9 @@ function M.preview_query()
buffer = query_buf,
desc = 'Update query previewer highlights when the cursor moves',
callback = function()
- update_preview_highlights(query_win, win)
+ if api.nvim_win_is_valid(win) then
+ update_preview_highlights(query_win, win)
+ end
end,
})
api.nvim_create_autocmd('BufLeave', {