-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
First hit of ESC is swallowed by suggestions, have to hit it twice to leave insert mode #677
Comments
Yes, this was introduced by the latest version. Specifically, it allows parameter hints to swallow, not suggestions. I personally prefer the new way, but I understand if you prefer the old way. A quick fix is to change it in your user keybindings.json. However, if this bothers too many people, I am happy to revert it, or maybe provide a configuration toggle for it. Please let me know if this is a popular issue. |
Thanks @theol0403 , your suggested quick fix worked. For anyone else interested in reverting to the old behaviour:
|
👍 Should we keep the issue open? I don't know how much this change bothers other people. Btw, I think you should keep some of the when conditions, like the peek escape which is useful (when you have a peek open, but then you return to the original editor, escape will close the peek). Also, iirc doom emacs, one of the best examples of ide functionality + vim, makes escape close popups and notifications before it escapes insert mode. |
Actually, I am wrong with doom emacs, and this is a good issue. Using escape to close things in normal mode is valid, but maybe not in insert mode. Maybe, escape should only be sometimes sent to vscode in normal mode (to close things), but always exits insert mode in insert mode. I'll think about it |
A personal opinion that isn't based on how other IDE + Vim implementations solved this: I think escape should always exit insert mode, regardless of any suggestion the IDE might be displaying. I find it fiddly that depending on the last character I typed in insert mode & the language I'm in, there may or may not be a parameter hint displayed, and the number of ESC hits to get back to normal mode is variable. It does seem worth keeping as an option for those who disagree. My vote is in favour of the old behaviour being the default. |
I agree, escape must escape the insert mode. Also |
The people at #534 seem to have a different opinion, so I think it is best to either have a config option, or a snippet in the readme/wiki. However I think it is safe to intercept in normal mode by default. However, I agree that escape must escape the insert mode. |
Is there a way for the escape key to close the "hints popup" AND exits the insert mode? |
It seems to me that this is actually the case for the most part (with my PR), that the hints popup and suggestions leave when you exit insert mode. Is this not the case for you? |
Oh my bad, it's working as expected (exits insert mode & closes popup), I think VS Code chokes sometimes and the popup just follows my cursor in normal mode |
Not sure what I prefer. Adding an option would be great.
|
For anybody looking how to cancel prompt without leaving insert mode, try |
Second the opinion to not swallow Escape by default, or adding a simple toggle to disable swallowing. The swallowing behavior could be a nice thing for people transitioning from vscode to vim but it's quite unnatural for me as a vim user, because now depending on my situation, I have to pause and think do I have to press Escape once or twice to exit INSERT mode? After a while, I'm building up muscle memory to repetitively hitting Escape in all situations, and that's not a healthy habit to have. |
When the IntelliSense window is visible, hitting escape removes the suggestions but keeps me in insert mode. Initially it 'felt' as though some escape key presses were being dropped, I only figured out that this was what was happening by slowly trying to recreate it.
I'm fairly sure this was just recently introduced in the latest VSCode 1.57.1 release.
The gif below shows me pressing escape (⎋) twice to leave insert mode.
The text was updated successfully, but these errors were encountered: