which-key.nvim icon indicating copy to clipboard operation
which-key.nvim copied to clipboard

ignore_missing not showing mapping with "desc" field

Open liujoey opened this issue 1 year ago • 1 comments

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

liujoey avatar Oct 28 '22 19:10 liujoey

Thanks for the MR, because your MR got closed, I opened mine to fix the issue.

chovanecadam avatar Feb 20 '24 22:02 chovanecadam