fix(treesitter): validate window before updating preview highlights

This commit is contained in:
Maria José Solano authored and Lewis Russell committed 2023-08-27 09:40:26 +01:00
1 parent fec51229c4
commit 2bf3e82676
1 file changed
+3 -1
+3 -1
View File
@@ -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', {