From 4d77743a8ec4d19b3c47e0d04f3e88f1a933698e Mon Sep 17 00:00:00 2001 From: Xavier Young <45989017+younger-1@users.noreply.github.com> Date: Mon, 28 Nov 2022 03:04:07 +0800 Subject: feat(builtin.keymaps): display noremap/buffer indicators and add lhs filter (#2246) --- lua/telescope/make_entry.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lua/telescope/make_entry.lua') diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 2a17f80..699145c 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -827,11 +827,23 @@ function make_entry.gen_from_keymaps(opts) return utils.display_termcodes(entry.lhs) end + local function get_attr(entry) + local ret = "" + if entry.value.noremap ~= 0 then + ret = ret .. "*" + end + if entry.value.buffer ~= 0 then + ret = ret .. "@" + end + return ret + end + local displayer = require("telescope.pickers.entry_display").create { separator = "▏", items = { - { width = 2 }, + { width = 3 }, { width = opts.width_lhs }, + { width = 2 }, { remaining = true }, }, } @@ -839,6 +851,7 @@ function make_entry.gen_from_keymaps(opts) return displayer { entry.mode, get_lhs(entry), + get_attr(entry), get_desc(entry), } end -- cgit v1.2.3