Skip to content

Commit 29ee11c

Browse files
committed
fix(preview): buf can be deleted when preview (e.g. actions.buf_del)
1 parent d637241 commit 29ee11c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/fzf-lua/previewer/builtin.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ function Previewer.base:copy_extmarks()
656656
on_win = function(_, win, buf, topline, botline)
657657
if win ~= self.win.preview_winid then return end
658658
local src_buf = self.loaded_entry and self.loaded_entry.bufnr
659-
if not src_buf then return end
659+
if not src_buf or not api.nvim_buf_is_valid(src_buf) then return end
660660
copy_extmarks(src_buf, buf, win, topline, botline, self.ns_extmarks)
661661
return false
662662
end,

0 commit comments

Comments
 (0)