-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: which_key.show
dead-loops if the key has been remapped
#743
Comments
You did not:
|
Yes I do!
Updated the issue to include an MRE |
ok, sorry about that. I just looked into it and the reason that used to work is due to a bug in the old version. The new version won't even create a trigger at So what happens is:
So not an issue in which-key. |
This is interesting. Anyway, is it possible to inject function call before |
Probably, but that's for you to find out? Maybe keep a Might work, maybe not. I'm sure you'll figure something out |
A lot easier would be to just do: local reg = require("which-key.plugins.registers")
local expand = reg.expand
function reg.expand()
if vim.env.TMUX then
require("tmux.copy").sync_registers()
end
return expand()
end This way you don't have to mess with keymaps at all. |
This solution looks much simpler and more robust, thanks for pointing it out! |
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0
Operating system/version
Arch
Describe the bug
I'm adapting the which-key part of aserowy/tmux.nvim#88 for the recent refactor. The goal is to wrap the
"
key to invokerequire("tmux.copy").sync_registers()
before showing register contents.The old implementation for which-key before refactoring was:
and I updated it to:
However,
which_key.show
dead-loops with the new implementation.Steps To Reproduce
"
in normal mode+
Expected Behavior
no dead loop after selecting the register.
Health
No response
Log
No response
Repro
The text was updated successfully, but these errors were encountered: