-
-
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
Unexpectedly entered visual mode in snippet #7068
Comments
A temporary work around is to remove the default value. But this bug can be triggered by preceding snippet variables, sometimes it is impossible to work around. |
Up. I am writing another extension heavily using vscode snippets. Constantly running in this problem. Is there any solution to stop entering visual mode / auto go back to insert mode from within my extension or would it be possible to fix this issue? |
Seems related to #5240, I'm not sure if it was never fixed properly or if a regression happened. Calling |
The same issue happens when using code actions (CMD .) for Flutter such as "Wrap with Padding". Notice how it creates two cursors (one in the insert mode, the other in the visual mode). In this case, the visual mode cursor should be cancelled and VIM should go into the insert mode from Flutter code action. This issue happens in both visual and insert mode. Let me know if there's anything I can do to help debugging this issue, happy to provide more details or jump into the code! @J-Fields @draivin @berknam. This might be related to #5540. |
So it seems to me like this is something where the real solution is to have VSCode expose a snippet API so that the Vim extension can be told that a snippet is getting inserted, and override the normal process for ending up in insert mode at $1. Am I missing anything? How many users can we scratch together to upvote a bug so that we can propose an expansion to the API? Edit: I'm having this problem when inserting snippets from visual mode. Maybe we can write a wrapper command that goes into insert mode and makes the selection as if I had used the mouse while in insert mode, and then calls the insert snippet command? |
Describe the bug
With a custom snippet, vscode enters visual mode when [tab] is pressed (to use the snippet)
This blocks further editing until [esc] and [i] is pressed to enter insert mode again.
To Reproduce
( How to use snippets: https://code.visualstudio.com/docs/editor/userdefinedsnippets )
Expected behavior
Vscode should stay in insert mode.
Screenshots
Environment:
About VSCode:
Version: 1.60.0
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:54:53.442Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.2.0
The text was updated successfully, but these errors were encountered: