fix(treesitter): validate window before updating preview highlights

This commit is contained in:
Maria José Solano 2023-08-26 13:24:29 -07:00 committed by Lewis Russell
parent fec51229c4
commit 2bf3e82676

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', {