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: command `exe 'normal! gvy'` doesn't work as expected #658

Closed xwillq closed 1 month ago

xwillq commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10.0

Operating system/version

MacOS 14.5

Describe the bug

When executing exe 'normal! gvy', y is not executed, so nvim stays in visual mode and selection is not yanked.

Steps To Reproduce

  1. Type anything into buffer
  2. Select typed text with V
  3. Run :exe 'normal! gvy'

Expected Behavior

Register " should have contents of previous selection and nvim should be in normal mode, basically how it works without the plugin.

Health

No response

Log

Debug Started for v3.1.0
on_key: i
ModeChanged(n:i)
on_key: a
on_key: s
on_key: d
on_key: f
on_key: <Esc>
ModeChanged(i:n)
on_key: V
ModeChanged(n:V)
State(start): { "Mode(x)", "Node()", { update = true } }
  getchar
  on_key: <Esc>
  got: <Esc>
on_key: <Esc>
ModeChanged(V:n)
on_key: :
ModeChanged(n:c)
on_key: e
on_key: x
on_key: e
on_key: <Space>
on_key: '
on_key: n
on_key: o
on_key: r
on_key: m
on_key: !
on_key: <Space>
on_key: g
on_key: v
on_key: y
on_key: '
on_key: <CR>
ModeChanged(c:n)
ModeChanged(n:V)
State(start): { "Mode(x)", "Node()", { update = true } }
  getchar
  got: y
  reattach: { "y", "x" }
  feedkeys: { "Mode(x)", "y" }
on_key: <Esc>
ModeChanged(V:n)
on_key: :
ModeChanged(n:c)
on_key: q
on_key: a
on_key: !
on_key: <CR>
ModeChanged(c:n)

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 = {} },
  },
})