From e943f93a6a7078a823d84ef768859d93e7b1d7b5 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Wed, 24 May 2023 20:28:55 +0200 Subject: [PATCH] fix: make sure buf is valid before updating highlighting (#2524) --- lua/telescope/pickers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua index e049b89..a78d50b 100644 --- a/lua/telescope/pickers.lua +++ b/lua/telescope/pickers.lua @@ -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,