diff options
| author | fdschmidt93 <39233597+fdschmidt93@users.noreply.github.com> | 2022-05-09 11:08:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-09 11:08:53 +0200 |
| commit | 85239d9c3e0f0eaa728eb2369ef66c4a79fd997b (patch) | |
| tree | 68635b133edb13650f4c82a30fbe6b4abf495c44 /lua | |
| parent | 4681dcdffe20e1f23b6b9ccf28836537ed166c47 (diff) | |
feat(builtin.keymaps): show lua fn name if available (#1929)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/make_entry.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 627d669..5c39c4e 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -684,8 +684,12 @@ end function make_entry.gen_from_keymaps(opts) local function get_desc(entry) - return entry.desc or entry.rhs or "Lua function" + if entry.callback and not entry.desc then + return require("telescope.actions.utils")._get_anon_function_name(entry.callback) + end + return vim.F.if_nil(entry.desc, entry.rhs) end + local function get_lhs(entry) return utils.display_termcodes(entry.lhs) end |
