From 85239d9c3e0f0eaa728eb2369ef66c4a79fd997b Mon Sep 17 00:00:00 2001 From: fdschmidt93 <39233597+fdschmidt93@users.noreply.github.com> Date: Mon, 9 May 2022 11:08:53 +0200 Subject: [PATCH] feat(builtin.keymaps): show lua fn name if available (#1929) --- lua/telescope/make_entry.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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