diff --git a/lua/fzf-lua/core.lua b/lua/fzf-lua/core.lua index cc8db30a..9901b961 100644 --- a/lua/fzf-lua/core.lua +++ b/lua/fzf-lua/core.lua @@ -749,6 +749,12 @@ M.convert_reload_actions = function(reload_cmd, opts) if opts._is_skim or not opts.reload_actions then return opts end + -- Does not work with fzf version < 0.36, fzf fails with + -- "error 2: bind action not specified:" (#735) + local version = utils.fzf_version(opts) + if version < 0.36 then + return opts + end for k, v in pairs(opts.actions) do local action = type(v) == "function" and v or type(v) == "table" and v[1] if type(action) == "function" and opts.reload_actions[action] then diff --git a/lua/fzf-lua/utils.lua b/lua/fzf-lua/utils.lua index 9e8f9a50..befb0559 100644 --- a/lua/fzf-lua/utils.lua +++ b/lua/fzf-lua/utils.lua @@ -806,6 +806,11 @@ function M.neovim_bind_to_fzf(key) return key end +function M.fzf_version(opts) + local out = M.io_system({ opts.fzf_bin or "fzf", "--version" }) + return tonumber(out:match("(%d+.%d+).")) +end + function M.git_version() local out = M.io_system({ "git", "--version" }) return tonumber(out:match("(%d+.%d+)."))