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

This commit is contained in:
Simon Hauser
2023-05-24 20:28:55 +02:00
committed by GitHub
parent 9609686a8c
commit e943f93a6a

View File

@@ -857,7 +857,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,