mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
feat(picker.keymaps): improvements to keymaps picker
This commit is contained in:
parent
bc47e0b1dd
commit
2762c37eb0
5 changed files with 29 additions and 2 deletions
|
@ -237,11 +237,16 @@ function M.keymaps(opts)
|
|||
local done = {} ---@type table<string, boolean>
|
||||
for _, km in ipairs(maps) do
|
||||
local key = Snacks.picker.util.text(km, { "mode", "lhs", "buffer" })
|
||||
if not done[key] then
|
||||
local keep = true
|
||||
if opts.plugs == false and km.lhs:match("^<Plug>") then
|
||||
keep = false
|
||||
end
|
||||
if keep and not done[key] then
|
||||
done[key] = true
|
||||
local item = {
|
||||
mode = km.mode,
|
||||
item = km,
|
||||
key = km.lhs,
|
||||
preview = {
|
||||
text = vim.inspect(km),
|
||||
ft = "lua",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue