diff options
| author | fdschmidt93 <39233597+fdschmidt93@users.noreply.github.com> | 2022-04-22 15:52:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-22 15:52:22 +0200 |
| commit | d88094fbfd84b297178252230f6faf0e7d2f7650 (patch) | |
| tree | 2fb0d028d6fa42f990263052524cbd335b9a8d60 /lua/telescope/actions/init.lua | |
| parent | 92019d5053674676576b021904935d101b059fd5 (diff) | |
feat: show assigned function in actions.which_key (#1871)
Diffstat (limited to 'lua/telescope/actions/init.lua')
| -rw-r--r-- | lua/telescope/actions/init.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index 402c979..4c3b42a 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -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 |
