-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
insert mode bindings interfere with each other #4353
Comments
Does this work if you configure the keybinding via the VSCode settings file rather than a .vimrc? |
Agh my apologies, I set this up a while ago. The way I've implemented this is actually through the settings.json (User) file. I've pasted the whole file below, the first vim.insertModeKeyBindings is the one that's relevant here. So to be clear the title is incorrect, this is actually a case of vim.insertModeKeyBindings not working intermittently.
|
Thanks for clarifying. Was this working for you in 1.11.3 (the previous version)? |
OK after some confusing minutes debugging, it seems the way I originally described the bug was accurate. I've figured out I actually was both loading my vimrc file (with imap) and loading the above settings.json mappings. I tried removing each one and found that using just the imap from vimrc file has the issue mentioned above, but the keymap through settings.json seems to work fine. I've updated the post title once again, as it seems the bug as I originally laid it out really exists. But moving the setting to settings.json is a fine workaround for me. And yes, the way I had it configured worked as I intended in the previous version. |
OK it turns out the bug is not random, but is a function of the other vim.insertModeKeyBindings entry! The two bindings I have in my settings.json are triggered by typing "qr" and "thrun". Whenever one of them is possibly in progress, the other will not trigger. For instance, if I type "tqr", the "qr" binding will not be triggered because I started part of the "thrun" binding. Similarly, "thrqr" won't trigger the qr binding, and "qthrun" won't trigger the thrun binding. Note I spoke too soon in the above post. This bug exists regardless of how the qr mapping is defined. I deleted the qr mapipng from settings.json and added it to the imported vimrc and the same interaction occurs between the qr and thrun bindings. Sorry this started quite unorganized, but on the bright side I now have a fully reproducible non-random bug (on my machine at least). Please let me know what the best way to organize this is (i.e. should I rename this thread? Close this one and start a new one? Edit my first post to include the information here?). |
Nice, thanks for investigating! If you could just edit the title, that'd be awesome |
Just thought I'd stop by and confirm that I see the same behavior and provide a second repro in case it's useful. (I also thought it was random at first). My settings.json includes the following and in recent versions I can't use "jj" following a space. If I remove the second insertModeKeyBinding then jj works as expected.
|
This is a pretty massive change; see pull request #4735 for full details Most notably: - Support for operator-pending mode, including remaps and a half-cursor decoration - Correct handling of ambiguous remaps with timeout - Correct handling of recursive special case when the RHS starts with the LHS - Correct handling of multi-key remaps in insert mode - Failed movements that occur partway through a remap stop & discard the rest of the remap - Implement `unmap` and `mapclear` in .vimrc Refs #463, refs #4908 Fixes #1261, fixes #1398, fixes #1579, fixes #1821, fixes #1835 Fixes #1870, fixes #1883, fixes #2041, fixes #2234, fixes #2466 Fixes #2897, fixes #2955, fixes #2975, fixes #3082, fixes #3086 Fixes #3171, fixes #3373, fixes #3413, fixes #3742, fixes #3768 Fixes #3988, fixes #4057, fixes #4118, fixes #4236, fixes #4353 Fixes #4464, fixes #4530, fixes #4532, fixes #4563, fixes #4674 Fixes #4756, fixes #4883, fixes #4928, fixes #4991, fixes #5016 Fixes #5057, fixes #5067, fixes #5084, fixes #5125
Describe the bug
I have the following line in my .vimrc file:
imap qr
Until recently this has consistently worked. If I typed "qr" in insert mode, the qr would be deleted and I would return to normal mode. Today, about 80% of the time this works, but around 20% of the time this doesn't work. When it doesn't work, it simply types qr and stays in insert mode as if the imap didn't exist.
If it doesn't work, deleting the qr and typing it again usually fixes it (but sometimes fails about 20% of the time, and so on recursively...).
To Reproduce
Expected behavior
The imap should be respected, resulting in a return to normal mode as if Esc had been pressed.
Environment (please complete the following information):
Other extensions:
Configuration Editing
Node Debug Auto-attach
Emmet
Extension Authoring
Git
JSON Language Features
Merge Conflict
NPM support for VS Code
TypeScript and JavaScript Language Features
C/C++
The text was updated successfully, but these errors were encountered: