File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,6 +82,13 @@ return {
8282 end
8383 return act
8484 end , opts .actions )
85+ -- Hijack the resize event to reload buffer/tab list on unhide
86+ opts .keymap .fzf .resize = function ()
87+ if opts ._unhide_called then
88+ _G .dump (" call opts" , opts .__call_opts )
89+ end
90+ opts ._unhide_called = nil
91+ end
8592 return opts
8693 end ,
8794 },
Original file line number Diff line number Diff line change @@ -797,8 +797,8 @@ function M.fzf_winobj()
797797 return loadstring (" return require'fzf-lua'.win.__SELF()" )()
798798end
799799
800- function M .CTX ()
801- return loadstring (" return require'fzf-lua'.core.CTX()" )()
800+ function M .CTX (... )
801+ return loadstring (" return require'fzf-lua'.core.CTX(... )" )(... )
802802end
803803
804804function M .__CTX ()
Original file line number Diff line number Diff line change 11local path = require " fzf-lua.path"
22local utils = require " fzf-lua.utils"
3+ local libuv = require " fzf-lua.libuv"
34local config = require " fzf-lua.config"
45local actions = require " fzf-lua.actions"
56
@@ -1211,7 +1212,12 @@ end
12111212function FzfWin .unhide ()
12121213 local self = _self
12131214 if not self or not self :hidden () then return end
1214- self ._o .__CTX = utils .CTX ()
1215+ self ._o .__CTX = utils .CTX ({ includeBuflist = true })
1216+ self ._o ._unhide_called = true
1217+ -- Send SIGWINCH to to trigger resize in the fzf process
1218+ -- We will use the trigger to reload necessary buffer lists
1219+ local pid = fn .jobpid (vim .bo [self ._hidden_fzf_bufnr ].channel )
1220+ vim .tbl_map (function (_pid ) libuv .process_kill (_pid , 28 ) end , vim ._os_proc_children (pid ))
12151221 vim .bo [self ._hidden_fzf_bufnr ].bufhidden = " wipe"
12161222 self .fzf_bufnr = self ._hidden_fzf_bufnr
12171223 self ._hidden_fzf_bufnr = nil
You can’t perform that action at this time.
0 commit comments