mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-06-02 19:11:55 +00:00
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`.
(cherry picked from commit 4522d7e3ea)
This commit is contained in:
committed by
Simon Hauser
parent
fbe2b6c309
commit
d0f095243b
@@ -470,7 +470,10 @@ previewers.vimgrep = defaulter(function(opts)
|
||||
|
||||
define_preview = function(self, entry, status)
|
||||
-- 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
|
||||
if not has_buftype then
|
||||
p = from_entry.path(entry, true)
|
||||
|
||||
Reference in New Issue
Block a user