-
Notifications
You must be signed in to change notification settings - Fork 180
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
bug: Custom registered mappings don't have the correct name #482
Comments
Okay I debugged this a bit and removing this line fixes it. For some reason in this call the group has a name but |
This occurs starting with commit 8503c0d: The commit came shortly after discussing this issue with @folke : empty group names I see the same problem in LazyVim in the git submenu. This contains the "h" for the "hunks" submenu, labeled "prefix". --- fragment of gitsigns setup:
config = function(_, opts)
require("gitsigns").setup(opts)
require("lazyvim.util").on_load("which-key.nvim", function()
require("which-key").register({ mode = { "n", "v" }, ["<leader>gh"] = { name = "+hunks" } })
end)
end No luck, unfortunately. The "h" is still labeled prefix, all inner menu items are present. My knowledge of the which-key code is very limited. Given this limitation, my suggestion would be: Do show empty group names, as the user configures a group name with intent. The group name unexpectedly being empty shows a mismatch between the intent of the user and the actual code... |
hに指定したhunkのprefixが表示できなかったため、which-keyを削除した。代わりにmini.clueを追加した。これによって、hunkのprefixが表示できた。 どうも、これをみる感じ、使用できない状態だったから非表示になっていたのかもしれない。 folke/which-key.nvim#482 gitsignsはgitで管理されたファイルでしか使えないようで、それがnvim-treeでは使えない状態だったから非表示になっていたと思う。
This bug seems to be in v1.5.0+ only. Tested with v1.4.0 and it’s working as expected. |
+1 |
+1 |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.10.0-dev-673+g622ae2f53
Operating system/version
Mac Ventura 13.4.1
Describe the bug
Starting from version >= 1.5.0, mappings that I register using a custom name are displayed using
+prefix
instead of the name I configured.Steps To Reproduce
Register a group of commands that have a common prefix and register a name for
which-key
to use.For example, I register this set of rust commands when loading
rust-tools
:But
which-key
shows+prefix
instead of+rust
when pressing<leader>R
:Interestingly enough, the prefix does appear once I press
R
:Expected Behavior
For
which-key
to always show the name I configured.The text was updated successfully, but these errors were encountered: