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: Long delay at the bottom of Go files after pressing z #660

Closed eXvimmer closed 1 month ago

eXvimmer commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0

Operating system/version

Ubuntu

Describe the bug

In a Go file with multiple lines, when I press Gz (or Gzt) , I experience a 2 seconds delay. This only happens when I'm in a Go file and in the last line.

Steps To Reproduce

  1. Create a Go file with multiple lines of code.
  2. Go to the last line
  3. press z

Expected Behavior

The delay should be the same like other cases.

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.
- WARNING |mini.icons| is not 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`, <gc> overlaps with <gcc>:
  - <gc>: Toggle comment
  - <gcc>: Toggle comment line
- WARNING In mode `n`, <yS> overlaps with <ySS>:
  - <yS>: Add a surrounding pair around a motion, on new lines (normal mode)
  - <ySS>: Add a surrounding pair around the current line, on new lines (normal mode)
- WARNING In mode `n`, <ys> overlaps with <yss>:
  - <ys>: Add a surrounding pair around a motion (normal mode)
  - <yss>: Add a surrounding pair around the current line (normal mode)
- WARNING In mode `n`, <\w> overlaps with <\wl>:
  - <\w>: VimWiki
  - <\wl>: Create or update the Table of Contents for the current wiki file
- 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 ~
- WARNING Duplicates for <<M-s>> in mode `s`:
  * Save all buffers: `{ nowait = true, remap = false, rhs = "<ESC><cmd>wall<CR>", silent = true }`
  * Save all buffers: `{ nowait = true, remap = false, rhs = "<ESC><cmd>wall<CR>", silent = true }`
- WARNING Duplicates for <<C-s>> in mode `s`:
  * Save buffer: `{ nowait = true, remap = false, rhs = "<ESC><cmd>silent update<CR>", silent = true }`
  * Save buffer: `{ nowait = true, remap = false, rhs = "<ESC><cmd>silent update<CR>", silent = true }`
- OK Duplicate mappings are only reported for informational purposes.
  This doesn't necessarily mean there is a problem with your config.

Log

Debug Started for v3.2.0
on_key: ;
State(start): { "Mode(n)", "Node(;)", { keys = ";", update = true, waited = 0 } }
  getchar
  on_key: f
  got: f
  reattach: { ";f", "n" }
  detach: ;
  feedkeys: { "Mode(n)", ";f" }
on_key: ;f
ModeChanged(n:i)
attach: { ";", "n" }
on_key: h
on_key: e
on_key: l
on_key: p
on_key: <CR>
ModeChanged(i:n)
on_key: G
on_key: z
State(start): { "Mode(n)", "Node(z)", { keys = "z", update = true, waited = 0 } }
  getchar
  on_key: t
  got: t
  reattach: { "zt", "n" }
  detach: z
  feedkeys: { "Mode(n)", "zt" }
on_key: z
on_key: t
attach: { "z", "n" }
on_key: ;
State(start): { "Mode(n)", "Node(;)", { keys = ";", update = true, waited = 0 } }
  getchar
  on_key: q
  got: q
  reattach: { ";q", "n" }
  detach: ;
  feedkeys: { "Mode(n)", ";q" }
on_key: ;q
attach: { ";", "n" }

Repro

return require("lazy").setup({
    { "folke/which-key.nvim", event = "UIEnter", opts = { preset = "modern" } },
})
folke commented 1 month ago

That's not a repro and I don't use go. If you want me to look at it at least provide a proper repro. Closing...