folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
5.12k stars 163 forks source link

bug: helth check does not differentiate <tab> and <c-i> #674

Closed s1n7ax closed 1 month ago

s1n7ax commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.11.0-nightly+10256bb

Operating system/version

NixOs

Describe the bug

In the which key health check, it displays the following overlapping keymaps.

- WARNING In mode `n`, <<Tab>> overlaps with <<Tab>i>, <<Tab>m>, <<Tab>e>, <<Tab>n>:
  - <<Tab>>: Jump to right window
  - <<Tab>i>: Split right
  - <<Tab>m>: Split left
  - <<Tab>e>: Split top
  - <<Tab>n>: Split bottom

I'm using <c-i> instead of <tab> to jump to right window.

image image

Following are the nmap <tab> result.

n  <Tab>i      * <Lua 843: ~/.config/nvim/lua/utils/window.lua:10>
                 Split right
n  <Tab>e      * <Lua 842: ~/.config/nvim/lua/utils/window.lua:17>
                 Split top
n  <Tab>n      * <Lua 100: ~/.config/nvim/lua/utils/window.lua:24>
                 Split bottom
n  <Tab>m      * <Lua 107: ~/.config/nvim/lua/utils/window.lua:3>
                 Split left

Sometime ago there was the default mapping <c-i> to <tab> from the terminal it self as well as within Neovim. But it was changed including <c-i>. So I guess it's probably ok to consider differentiate <c-i> and <tab> https://github.com/neovim/neovim/pull/17932

Steps To Reproduce

  1. Add keymap nmap <c-i> :echo "c-i"<cr>
  2. Add keymap nmap <tab>i :echo "tab-i"<cr>
  3. Check health

Expected Behavior

Which key should not consider <c-i> as <tab>.

Health

No response

Log

No response

Repro

-
folke commented 1 month ago

<c-i> and <tab> IS the same

folke commented 1 month ago

check with :=vim.fn.keytrans(vim.keycode("<tab>"))