fix(util): better keymap normalization

This commit is contained in:
Folke Lemaitre 2025-02-01 09:40:41 +01:00
parent de16b44f97
commit e1566a483d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 53 additions and 7 deletions

View file

@ -398,8 +398,7 @@ function M:toggle_help(opts)
local done = {} ---@type table<string, boolean>
for _, keymap in ipairs(keys) do
local key = vim.fn.keytrans(Snacks.util.keycode(keymap.lhs or ""))
key = key == "<NL>" and "<C-J>" or key
local key = Snacks.util.normkey(keymap.lhs or "")
if not done[key] and not (keymap.desc and keymap.desc:find("which%-key")) then
done[key] = true
row = row + 1