@ 261105.2

260223.16 · 8c6226a869567cafdf8452265540a8c58b929fe0

fix: global picker cannot toggle-preview on split layout

reading declarations

lua/fzf-lua/core.lua

@@ -389,6 +389,19 @@ M.fzf = function(contents, opts)     end)   end +  -- Hijack the resize event to reload buffer/tab list on unhide+  win.on_SIGWINCH(opts, "win.unhide", function()+    local reload = type(opts._contents) == "string"+        and (opts._resume_reload == true+          ---@diagnostic disable-next-line: need-check-nil+          or type(opts._resume_reload) == "function" and opts._resume_reload(opts))+    if reload then+      return string.format("%sreload:%s",+        type(reload) == "string" and reload .. "+" or "",+        opts._contents)+    end+  end)+   -- live command may contain field index {q}, cannot be used as FZF_DEFAULT_COMMAND   local selected, exit_code = fzf.raw_fzf(opts.is_live and utils.shell_nop() or contents,     M.build_fzf_cli(opts),

lua/fzf-lua/profiles/hide.lua

@@ -92,18 +92,6 @@ return {         end         opts.actions[k] = act       end-      -- Hijack the resize event to reload buffer/tab list on unhide-      FzfLua.win.on_SIGWINCH(opts, "win.unhide", function()-        local reload = type(opts._contents) == "string"-            and (opts._resume_reload == true-              ---@diagnostic disable-next-line: need-check-nil-              or type(opts._resume_reload) == "function" and opts._resume_reload(opts))-        if reload then-          return string.format("%sreload:%s",-            type(reload) == "string" and reload .. "+" or "",-            opts._contents)-        end-      end)       return opts     end,   },

lua/fzf-lua/test/helpers.lua

@@ -122,6 +122,7 @@ M.new_child_neovim = function()   child.init = function()     child.restart({ "-u", "scripts/minimal_init.lua" })     child.cmd("cd deps/fzf-lua")+     -- Change initial buffer to be readonly. This not only increases execution     -- speed, but more closely resembles manually opened Neovim.     child.bo.readonly = false

tests/actions_spec.lua

@@ -16,8 +16,14 @@ local T = helpers.new_set_with_child(child) T["actions"] = new_set({ n_retry = not helpers.IS_LINUX() and 5 or nil })  T["actions"]["ui don't freeze on error"] = function()+  helpers.SKIP_IF_NOT_NIGHTLY()   -- reload({ "hide" })-  local screen_opts = { ignore_text = { 28 } }+  local screen_opts = { start_line = 1, end_line = 10, ignore_text = { 28 } }+  -- fix flaky hit enter prompt on windows+  exec_lua([[+    local extui = vim.F.npcall(require, 'vim._core.ui2') or vim.F.npcall(require, 'vim._extui')+    if extui then extui.enable({}) end+  ]])   exec_lua(     [[FzfLua.fzf_exec({ "aaa", "bbb" }, {       actions = { enter = { fn = error, exec_silent = true } },

tests/screenshots/tests-actions_spec.lua---actions---ui-don't-freeze-on-error

@@ -9,21 +9,3 @@ 08|~      │                                                 │       09|~      │                                                 │       10|~      │                                                 │      -11|~      │                                                 │      -12|~      │                                                 │      -13|~      │                                                 │      -14|~      │                                                 │      -15|~      │                                                 │      -16|~      │                                                 │      -17|~      │                                                 │      -18|~      │                                                 │      -19|~      │                                                 │      -20|~      │                                                 │      -21|~      │                                                 │      -22|~      ╰─────────────────────────────────────────────────╯      -23|~                                                               -24|[No Name]                                     0,0-1          All-25|                                                                -26|                                                                -27|                                                                -28|-- TERMINAL --                                1,39          All 

tests/screenshots/tests-actions_spec.lua---actions---ui-don't-freeze-on-error-002

@@ -9,21 +9,3 @@ 08|~      │                                                 │       09|~      │                                                 │       10|~      │                                                 │      -11|~      │                                                 │      -12|~      │                                                 │      -13|~      │                                                 │      -14|~      │                                                 │      -15|~      │                                                 │      -16|~      │                                                 │      -17|~      │                                                 │      -18|~      │                                                 │      -19|~      │                                                 │      -20|~      │                                                 │      -21|~      │                                                 │      -22|~      ╰─────────────────────────────────────────────────╯      -23|~                                                               -24|[No Name]                                     0,0-1          All-25|                                                                -26|                                                                -27|                                                                -28|-- TERMINAL --                                1,40          All