fix: jumplist picker resume after bwipeout (#2753)
With this change we will check if the provided buffer number is valid, before querying its `buftype` option. This is necessary, because currently we would fail with: ``` Error executing vim.schedule lua callback: ...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:473: Invalid buffer id: X ``` error, if we try to resume a jumplist picker after doing `:bwipeout`.
This commit is contained in:
@@ -563,7 +563,10 @@ previewers.vimgrep = defaulter(function(opts)
|
|||||||
|
|
||||||
define_preview = function(self, entry)
|
define_preview = function(self, entry)
|
||||||
-- builtin.buffers: bypass path validation for terminal buffers that don't have appropriate path
|
-- builtin.buffers: bypass path validation for terminal buffers that don't have appropriate path
|
||||||
local has_buftype = entry.bufnr and vim.api.nvim_buf_get_option(entry.bufnr, "buftype") ~= "" or false
|
local has_buftype = entry.bufnr
|
||||||
|
and vim.api.nvim_buf_is_valid(entry.bufnr)
|
||||||
|
and vim.api.nvim_buf_get_option(entry.bufnr, "buftype") ~= ""
|
||||||
|
or false
|
||||||
local p
|
local p
|
||||||
if not has_buftype then
|
if not has_buftype then
|
||||||
p = from_entry.path(entry, true)
|
p = from_entry.path(entry, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user