fix: make sure buf is valid before updating highlighting (#2524)

(cherry picked from commit e943f93a6a)
This commit is contained in:
Simon Hauser
2023-05-24 20:28:55 +02:00
parent ec42e02030
commit a5881cffc3
+1 -1
View File
@@ -853,7 +853,7 @@ end
function Picker:_reset_prefix_color(hl_group)
self._current_prefix_hl_group = hl_group or nil
if self.prompt_prefix ~= "" then
if self.prompt_prefix ~= "" and a.nvim_buf_is_valid(self.prompt_bufnr) then
vim.api.nvim_buf_add_highlight(
self.prompt_bufnr,
ns_telescope_prompt_prefix,