-
-
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
Using single 'q' character for <ESC> binding in Insert mode removes the last typed character #1076
Comments
@alexeygrant Thanks for reporting this! A temporary workaround until we fix this: If you have any other mappings that use 2 keys, if you remove them, this one will work fine. For example, I can reproduce this if I have jj mapped to AND q mapped to , jj then works correctly but q removes the extra char. If I have ONLY q mapped to it works correctly. This has to do with _longestKeySequence() being checked in remapper.ts |
I had to type "sequence" to fix this. I kept messing it all up because I would type se q (exit insert) u (undo my change) and it took me 3 times of that to realize that I had added this q to esc binding to debug this issue 😆 |
Yes, indeed, I had another binding - "zz" to "q" in the insert mode :). Thanks for the workaround, I'll survive for some time. |
I have a pull request out so it should be in the next release! |
Hmm, I didn't realise the fix was there for some time already :). It now works fine with a single character mapping to to ESC. Thanks a lot. |
No problem! |
Please thumbs-up 👍 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.
What did you do?
In vim/VsVim I bind 'q' to <ESC> in the insert mode. Therefore I've configured this binding:
"vim.insertModeKeyBindingsNonRecursive": [
{
"before": ["q"],
"after": [""]
}
]
Put the exact keys you pressed.
Type anything in Insert mode, then press 'q'
What did you expect to happen?
Pressing 'q' would exit Insert mode.
What happened instead?
Pressing 'q' removes the last typed character and then exits Insert mode (exactly as if press ESC).
Technical details:
The text was updated successfully, but these errors were encountered: