Skip to content

Commit 15d5cd9

Browse files
committed
feat: reload bind with fzf load as lua callback
1 parent 487064d commit 15d5cd9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/fzf-lua/core.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,11 +1218,15 @@ M.convert_reload_actions = function(reload_cmd, opts)
12181218
end
12191219
end
12201220
opts.keymap.fzf.load = (function()
1221+
-- NOTE: this fixes existence of both load as function and rebind, e.g. git_status with:
1222+
-- setup({ keymap = { fzf = { true, load = function() _G._fzf_load_called = true end } } }
1223+
if type(opts.keymap.fzf.load) == "function" then
1224+
opts.keymap.fzf.load = "execute-silent:" ..
1225+
shell.raw_action(opts.keymap.fzf.load, nil, opts.debug)
1226+
end
12211227
if rebind and type(opts.keymap.fzf.load) == "string" then
12221228
return string.format("%s+%s", rebind, opts.keymap.fzf.load)
12231229
else
1224-
-- TODO: fix existence of both load as function and rebind, e.g. git_status with:
1225-
-- setup({ keymap = { fzf = { true, load = function() _G._fzf_load_called = true end } } }
12261230
return rebind or opts.keymap.fzf.load
12271231
end
12281232
end)()

0 commit comments

Comments
 (0)