which-key.nvim
which-key.nvim copied to clipboard
ignore_missing not showing mapping with "desc" field
I'm using Lunarvim, one thing that the LSP module in lvim set buffer keys using
local opts = { buffer = bufnr, desc = remap[2], noremap = true, silent = true }
vim.keymap.set(mode_char, key, remap[1], opts)
The opts
can only have desc
but not label
, here remap[2]
is really the value for a label.
This turns out in which-key.keys#get_mappings method, some of the mappings we get only have value.desc
but not value.label
If we use ignore_missing option here, these keybindings will be skipped by which-key
I propose a PR which add the following logic
if not value.label and value.desc then
value.label = value.desc
end
Thanks for the MR, because your MR got closed, I opened mine to fix the issue.