Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore_missing not showing mapping with "desc" field #355

Closed
liujoey opened this issue Oct 28, 2022 · 1 comment · Fixed by #577
Closed

ignore_missing not showing mapping with "desc" field #355

liujoey opened this issue Oct 28, 2022 · 1 comment · Fixed by #577

Comments

@liujoey
Copy link

liujoey commented Oct 28, 2022

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
@chovanecadam
Copy link
Contributor

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

@folke folke closed this as completed in #577 Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants