Skip to content

Commit ec8b3b2

Browse files
committed
perf(ctx): skip hidden bufnr validation
1 parent 9b382a9 commit ec8b3b2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lua/fzf-lua/ctx.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ M.refresh = function(opts)
4343
-- never cleared. The below condition validates the source window when the
4444
-- UI is not open (#907)
4545
or (not winobj and ctx.bufnr ~= vim.api.nvim_get_current_buf())
46-
-- we should never get here when fzf process is hidden unless the user requested
47-
-- not to resume or a different picker, i.e. hide files and open buffers
48-
or winobj and (winobj:hidden() or winobj:was_hidden())
46+
-- we don't get here when hidden fzf process is resumed, only when the user
47+
-- starts a different picker, i.e. hide files and open buffers, in this case
48+
-- we update ctx regardless of hidden buf validity as the underlying fzf
49+
-- job/bufnr may have also been terminated (#2715)
50+
or winobj and winobj._hidden_fzf_bufnr
4951
then
5052
ctx = {
5153
mode = vim.api.nvim_get_mode().mode,

0 commit comments

Comments
 (0)