diff options
| author | Xavier Young <45989017+younger-1@users.noreply.github.com> | 2022-11-28 03:04:07 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-27 20:04:07 +0100 |
| commit | 4d77743a8ec4d19b3c47e0d04f3e88f1a933698e (patch) | |
| tree | 891e3e54d184c00cd07a0e1ae97a7dab92fe5a95 /lua/telescope/make_entry.lua | |
| parent | 343a2b6b712eb42ae5a319d484508cc5e9e483b0 (diff) | |
feat(builtin.keymaps): display noremap/buffer indicators and add lhs filter (#2246)
Diffstat (limited to 'lua/telescope/make_entry.lua')
| -rw-r--r-- | lua/telescope/make_entry.lua | 15 |
1 files changed, 14 insertions, 1 deletions
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 |
