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: `gv` does not respect which-key delay. #755

Closed feekApp closed 1 month ago

feekApp commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0 (homebrew, stable::)

Operating system/version

macOs 15.5

Describe the bug

Hi,

it seems like that gv(Start Visual mode with the same area as the previous area and the same mode) does not respect the delay set in which-key options. When pressing gv, the which-key popup is shown immediately.

Steps To Reproduce

  1. select some text via visual mode and yank text
  2. press gv
  3. which-key popup is shown immediately, without delay.

Expected Behavior

Use the set delay.

Health

No response

Log

No response

Repro

No response

folke commented 1 month ago

Can't reproduce. Provide a repro with exact steps to reproduce if you want me to further look into this.

feekApp commented 1 month ago

Hi Folke,

its ver strange, it seems happening for only one value of delay, namely 1000.

How to reproduce:

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", 
          event = "VeryLazy",
          opts = {
              delay = 1000,
          },

     },
    -- add any other plugins here
  },
})

for this config the popup does not have any delay, changing the delay value to 1010 or 999 the delay is present as expected.

folke commented 1 month ago

ok, sow when it's exactly the same as timeoutlen. Will check

feekApp commented 1 month ago

yep

feekApp commented 1 month ago

just checked, when changing timeoutlen to (exactly) the delay value (no matter what value) the delay is gone.

feekApp commented 1 month ago

Thnx for the quick fix!