Closed Serega124 closed 1 month ago
seems to be the source for https://github.com/LazyVim/LazyVim/issues/4286
This might be the same issue as #807
This replicates for some built-in mappings as well, for example ge
The bug was introduced on commit 96b2e9397937.
A hack for this would be to modify the following snippet on lua/which-key/buf.lua:69
to fix the double recordings issue, however this will prevent which-key from showing up when recording macros.
- if Config.triggers.modes[self.mode] then
+ if Config.triggers.modes[self.mode] and vim.fn.reg_recording() == "" then
-- Auto triggers
self.tree:walk(function(node)
if is_safe(node, true) then
table.insert(self.triggers, node)
return false
end
end)
end
I can confirm this using only bindings as well.
repro.lua
:
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
},
})
Steps:
nvim -u repro.lua
- open NeovimqqgUlq
- record a simple macro to the q
register:reg q
- see gUgUl
is in the registernot fixed, still experiencing https://github.com/folke/flash.nvim/issues/366 after upgrading which-key to fb07034/3.13.3
, with slightly different output
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.1
Operating system/version
Windows 10 (10.0.19045.4651)
Describe the bug
When recording a macro using user key mappings the recorded keys are inserted twice in the register, and are also played back twice. This occurs with which-key enabled in the minimal
repro.lua
. Using the same repro without which-key enabled, ornvim --clean
, the issue does not occur.Similar issue: #702 which-key v3.13.2
Steps To Reproduce
qq
repro.lua
:<Space>t
q
:registers
command -"q
register will containt t
instead oft
Q
- user keymap will be executed twiceExpected Behavior
Not to double record user keystrokes to macros
Health
Log
Repro