Closed mehalter closed 1 month ago
A minit
user in the wild :) I'm not even using that repro yet. Need to do that soon.
As for your question. There is no group
description in the repro?
oh wait. The desc shown in which-key should be the ones provided by add()
. Will check
A group shold be like below, but it still doesnt work:
require("which-key").add({
{ "<Leader>g", group = "Test", mode = { "n", "v" }, buffer = buf },
})
For mappings without a right hand side, would just setting the desc
work as well? Or it should always be group
? It seems like in the global context either seem to work
The docs indicate that desc
is a required field (https://github.com/folke/which-key.nvim?tab=readme-ov-file#%EF%B8%8F-setup)
Is this the case? Also what would the meaning of specifying group
and desc
in a mapping? What's the reason for separating it out since only one label can ever be displayed?
That fixed it, thanks so much! Still a bit curious if it's alright to only use desc
in this way or if there is something I'm missing that could bite me down the road.
Thanks so much for such an expedient fix!!!
Fixed.
Need to update the docs. Either group or desc needs to be present.
The difference matters to know which mappings should still be shown.
A single mapping without children can only be removed when it's a group mapping.
Other single mappings (like the ones LazyVim adds for mini.ai
), can't be removed.
to be clear: manual mappings (so no real keymaps) that don't have any children are not shown, unless they are not a group node.
So for this specific use-case it's fine to use desc
as well
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
Arch Linux
Describe the bug
Love the new v3 update so far! I stumbled across one bug so far though. I found that buffer local mapping groups set up with just a description for "menu titles" don't seem to have any effect.
Steps To Reproduce
nvim -u repro.lua
, start neovim:lua vim.g.test_function()
, set the buffer local mappings to the current buffer\
, press the leader key and see that there is no description "Test"Expected Behavior
Descriptions for buffer local keymapping groups should be displayed in which-key
Repro