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

bug: Adding description for << or >> replaces all other keys after first < or > #890

Open
4 tasks done
powerman opened this issue Nov 16, 2024 · 3 comments
Open
4 tasks done
Labels
bug Something isn't working stale

Comments

@powerman
Copy link

Did you check docs and existing issues?

  • I have read all the which-key.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of which-key.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.2

Operating system/version

Gentoo Linux

Describe the bug

In default setup Which-Key shows about 30 keys following < or > in +Indent right|left menus. But these 30 keys does not include second < or > keys (see :help << or :help >>). If I add description for << or >> then it will be only listed description in these menus (other 30 will gone).

Steps To Reproduce

  1. nvim -u repro.lua.
  2. Press > or <.
  3. You'll see menu with only one key (> or <) instead of default 30 keys plus this one.

Expected Behavior

Have default 30 keys plus one more for < or > in a menu.

Health

==============================================================================
which-key: require("which-key.health").check()

- OK Most of these checks are for informational purposes only.
  WARNINGS should be treated as a warning, and don't necessarily indicate a problem with your config.
  Please |DON'T| report these warnings as an issue.

Checking your config ~
- WARNING |mini.icons| is not installed
- WARNING |nvim-web-devicons| is not installed
- WARNING Keymap icon support will be limited.

Checking for issues with your mappings ~
- OK No issues reported

checking for overlapping keymaps ~
- WARNING In mode `n`, <gc> overlaps with <gcc>:
  - <gc>: Toggle comment
  - <gcc>: Toggle comment line
- OK Overlapping keymaps are only reported for informational purposes.
  This doesn't necessarily mean there is a problem with your config.

Checking for duplicate mappings ~
- OK No duplicate mappings found

Log

Debug Started for v3.13.3
{
  branch = "main",
  commit = "68e37e12913a66b60073906f5d3f14dee0de19f2"
}
new Mode(n:1)
Trigger(add) Mode(n:1) ` ' " z= g' g` < z g <Plug> ] [ > <C-W>
on_key: <lt>
State(start): Mode(n:0) Node(<) { keys = "<" }
  update Mode(n:1)
  continue: < Mode(n:1)
  getchar
  on_key: <Esc>
  got: <Esc>
on_key: >
State(start): Mode(n:0) Node(>) { keys = ">" }
  update Mode(n:1)
  continue: > Mode(n:1)
  getchar
  on_key: <Esc>
  got: <Esc>
on_key: :
ModeChanged(n:c)
  new Mode(c:1)
  Safe(true)
Trigger(add) Mode(c:1) <C-R>
on_key: q
on_key: <CR>
ModeChanged(c:n)
  Unsafe(command-mode)
  suspend: Mode(n:1)
  Trigger(del) Mode(n:1) > ' " <C-W> z= ] g' g` < z g <Plug> ` [
Trigger(add) Mode(n:1) ` ' " z= g' g` < z g <Plug> ] [ > <C-W>

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
            "folke/which-key.nvim",
            opts = {
                spec = {
                    { "<lt><lt>", desc = "Lines" },
                    { ">>", desc = "Lines" },
                },
            },
  },
})
@powerman powerman added the bug Something isn't working label Nov 16, 2024
Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Dec 17, 2024
@powerman
Copy link
Author

bump

@github-actions github-actions bot removed the stale label Dec 18, 2024
Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant