Closed ir-ae closed 1 month ago
I'm having a similar issue with nvim-surround. The previous version would display options for surround's keys like ys
and ds
. Wk doesn't display anything for nvim-surround now. Also, in the previous version "native" operations like dw
would execute instantly. In v3, operator pending keys like dw
, cw
, and ciw
don't execute instantly, it pauses and shows many options.
@roycrippen4 that is not related to this issue and I can't reproduce that. If you want me to look at it, submit an issue with a working repro.
Should be fixed now.
Note that typing d
first and then waiting to press s
later won't work.
That might have worked with which-key before, but no longer works as this was incorrect.
vim-sandwish
doesn't seem to define an omap
for s
, and only has a normal mode ds
mapping.
When you press d
you enter operator pending mode so only omaps
work at that point.
vim-sandwish
doesn't seem to define anomap
fors
, and only has a normal modeds
mapping.When you press
d
you enter operator pending mode so onlyomaps
work at that point.
In which-key-less Neovim it enters Operator-pending only after it is sure that only d
is pressed. So making a ds
Normal mode mapping is enough. Moreover, I don't think creating s
Operator-pending mode mapping is a correct way to make ds
work as operator (at least because it will be present for every operator, which is not intended).
This might be related to echasnovski/mini.nvim#1058.
This is unrelated to which key though. D or ds doesn't trigger any which key keymaps, so timeoutlen works as normal for those mappongs
Yeah, I've just tried to reproduce the echasnovski/mini.nvim#1058 with 'which-key.nvim' and it seems to work as I'd expect. The core description of the issue is "before, s
will show which-key and wait for next action (add, delete ...) but now it just uses nvims default s action( replacing current char going into insert mode).", however I could not reproduce this even before v3.
So as a user, I'm wondering if which-key
is supposed to work with mini.surround
default keybindings somehow with or without additional configuration? Specifically for the initial key bindings when you press only s
-> sa
, sd
, sr
etc...
I have also disabled s key:
vim.keymap.set({ "n", "x" }, "s", "<Nop>")
If you press only s
, then Neovim's s
keybinding will be executed.
mini.surround
only maps sa
and others, not the bare s
mapping.
Old which-key messed up the normal NEovim behavior in this case. v3 does it how it should.
If you want to show which-key
on s
, you can add a keymap for s
to WhichKey n s
Awesome! Thanks a lot! I finally got it to work 👍
I'm having the same problem as I had with ds
when trying to change or delete text with c/{pattern}<cr>
or d/{pattern}<cr>
. Should I open another issue for that?
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713484068
Operating system/version
Windows 10
Describe the bug
Which-key displays and waits for another key press after executing vim-sandwhich surround motions such as
ds(
,ds{
It only shows foryS
,S
,ys
andcs
if you dont type the whole command before the which-key delay but it shows regardless of typing speed fords
Steps To Reproduce
(word)
ds(
Expected Behavior
Do not display which-key after completed vim-sandwich keymap
Health
Log
Repro