added 'vim.ui.select' action help string

main
bhagwan 2 years ago
parent e4dcd44fb3
commit f2ebd3b9c3

@ -708,7 +708,7 @@ function M.normalize_opts(opts, defaults)
end
M.set_action_helpstr = function(fn, helpstr)
assert(type(fn) == 'function' and type(helpstr) == 'string')
assert(type(fn) == 'function')
M._action_to_helpstr[fn] = helpstr
end

@ -1,5 +1,6 @@
local core = require "fzf-lua.core"
local utils = require "fzf-lua.utils"
local config = require "fzf-lua.config"
local actions = require "fzf-lua.actions"
local M = {}
@ -78,8 +79,12 @@ M.ui_select = function(items, opts, on_choice)
end
})
config.set_action_helpstr(_opts.actions['default'], "accept-item")
core.fzf_wrap(_opts, entries, function(selected)
config.set_action_helpstr(_opts.actions['default'], nil)
if not selected then
on_choice(nil, nil)
return

Loading…
Cancel
Save