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: #759

Closed Epipeppy closed 1 month ago

Epipeppy commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.5

Operating system/version

Nobara 39

Describe the bug

Error when changing modes. Upon pressing d, c, V, or v I get an error stating that the field 'list_contains' (a nil value). Image attached. which-key_error

Steps To Reproduce

  1. Open Neovim.
  2. Press V (or any of the other aforementioned keys).

Expected Behavior

Mode change with a list of keybindings displayed.

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 ~
- OK |mini.icons| is installed
- OK |nvim-web-devicons| is installed

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

checking for overlapping keymaps ~
- WARNING In mode `n`, <gb> overlaps with <gbc>:
  - <gb>: Comment toggle blockwise
  - <gbc>: Comment toggle current block
- WARNING In mode `n`, <gc> overlaps with <gcO>, <gcA>, <gcc>, <gco>:
  - <gc>: Comment toggle linewise
  - <gcO>: Comment insert above
  - <gcA>: Comment insert end of line
  - <gcc>: Comment toggle current line
  - <gco>: Comment insert below
- WARNING In mode `n`, <sh> overlaps with <shn>, <shl>:
  - <sh>: Highlight surrounding
  - <shn>: Highlight next surrounding
  - <shl>: Highlight previous surrounding
- WARNING In mode `n`, <sf> overlaps with <sfn>, <sfl>:
  - <sf>: Find right surrounding
  - <sfn>: Find next right surrounding
  - <sfl>: Find previous right surrounding
- WARNING In mode `n`, <sF> overlaps with <sFn>, <sFl>:
  - <sF>: Find left surrounding
  - <sFn>: Find next left surrounding
  - <sFl>: Find previous left surrounding
- WARNING In mode `n`, <sr> overlaps with <srn>, <srl>:
  - <sr>: Replace surrounding
  - <srn>: Replace next surrounding
  - <srl>: Replace previous surrounding
- WARNING In mode `n`, <sd> overlaps with <sdn>, <sdl>:
  - <sd>: Delete surrounding
  - <sdn>: Delete next surrounding
  - <sdl>: Delete previous surrounding
- WARNING In mode `x`, <i> overlaps with <il>, <in>:
  - <i>: inside
  - <il>: Inside last textobject
  - <in>: Inside next textobject
- WARNING In mode `x`, <a> overlaps with <a%>, <al>, <an>:
  - <a>: around
  - <al>: Around last textobject
  - <an>: Around next textobject
- WARNING In mode `o`, <a> overlaps with <al>, <an>:
  - <a>: around
  - <al>: Around last textobject
  - <an>: Around next textobject
- WARNING In mode `o`, <i> overlaps with <il>, <in>:
  - <i>: inside
  - <il>: Inside last textobject
  - <in>: Inside next textobject
- 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.9.0
new Mode(n:1)
Trigger(add) Mode(n:1) ' ` " g` g' z= g <C-W> ] [ <Space> z
State(start): Mode(n:0) Node(<Space>) { keys = "<Space>", waited = 0 }
  update Mode(n:1)
  continue: <Space> Mode(n:1)
  getchar
  got: <Esc>
ModeChanged(n:V)
  new Mode(x:1)
  Safe(true)
  Trigger(add) Mode(x:1) " g z <C-W> <Space> [ ]
  ModeChanged(V:n)
    Safe(true)
  ModeChanged(n:c)
    new Mode(c:1)
    Safe(true)
  Trigger(add) Mode(c:1) <C-R>
  ModeChanged(c:n)
    Unsafe(command-mode)
    suspend: Mode(n:1)
    Trigger(del) Mode(n:1) ` " g` g' z= g <C-W> ] [ <Space> z '
  BufNew(4)
  BufNew(5)
  BufEnter(5)
    new Mode(n:5)
  BufEnter(4)
    new Mode(n:4)
  Trigger(add) Mode(n:4) ' ` " g` g' z= g <C-W> ] [ <Space> z
  Trigger(add) Mode(n:1) ' ` " g` g' z= g <C-W> ] [ <Space> z
  Trigger(add) Mode(n:5) ' ` " g` g' z= g <C-W> ] [ <Space> z
  ModeChanged(n:c)
    new Mode(c:4)
    Safe(true)
  Trigger(add) Mode(c:4) <C-R>
  ModeChanged(c:n)
    Unsafe(command-mode)
    suspend: Mode(n:4)
    Trigger(del) Mode(n:4) ' ` " g` g' z= g <C-W> ] [ <Space> z
  BufEnter(1)
  ModeChanged(n:c)
    Safe(true)
  ModeChanged(c:n)
    Unsafe(command-mode)
    suspend: Mode(n:1)
    Trigger(del) Mode(n:1) ' ` " g` g' z= g <C-W> ] [ <Space> z
  Trigger(add) Mode(n:1) ' ` " g` g' z= g <C-W> ] [ <Space> z

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 = {} },
    -- add any other plugins here
  },
})
folke commented 1 month ago

Was fixed already

Epipeppy commented 1 month ago

Sweet, thank you!