mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-05-31 02:06:03 +00:00
feat: show assigned function in actions.which_key (#1871)
This commit is contained in:
@@ -1128,6 +1128,16 @@ actions.which_key = function(prompt_bufnr, opts)
|
||||
table.insert(mappings, { mode = v.mode, keybind = v.keybind, name = name })
|
||||
end
|
||||
end
|
||||
elseif type(v.func) == "function" then
|
||||
if not opts.only_show_current_mode or mode == v.mode then
|
||||
local fname = action_utils._get_anon_function_name(v.func)
|
||||
table.insert(mappings, { mode = v.mode, keybind = v.keybind, name = fname })
|
||||
utils.notify("actions.which_key", {
|
||||
msg = "No name available for anonymous functions.",
|
||||
level = "INFO",
|
||||
once = true,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user