-
-
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
emmet.triggerExpansionOnTab
enters visual mode
#5884
Comments
I can't reproduce this on Windows 10. Can you show what happens when you do that with Vim disabled? Do you have any remaps in "vim.insertModeKeybindings" for the emmet trigger expansion command? |
No I don't. The only settings enabled are {
"emmet.showExpandedAbbreviation": "never",
"emmet.triggerExpansionOnTab": true
} I've disabled all extension and only enabled the vim extension and those settings. Note that the editor enters visual mode when Side NoteI noticed another thing, if you enable |
The same issue |
I am able to reproduce this on the Insiders version. I'm also able to reproduce this on normal version but only if using the commandId From what I can tell, this commit is the one that reintroduces the issue on the Insiders version by reverting the previous commit. There has been an update on the emmet extension which added the two expand commands, the old The @rzhao271 Hey! Sorry to bother. But can you help out here with this? |
I personally can reproduce it on both Insiders and non-Insiders version. And am sure that the expansion occurs via Btw, per #5495, I downgraded to 1.6 and the issue no longer persist. So I suspect there should be a commit between 1.6 and 1.7 that causes this. |
There was a change that makes it so that when vscode creates a selection Vim goes to visual mode. But there has been a change in emmet as well that is creating a selection before expanding the abbreviation and that is what is causing the issue. For me on windows 10, vscode 1.52.1 and Vim 1.18.5 with emmet settings by default if I type If I enable For some reason the default TAB keybinding to @cusxio Can you please check you "Keyboard Shortcuts" and search for |
Your debugging result seems consistent with mine. When
It's the default.
I think there's a subtle but important difference here.
TLDR: I think there's 2 ways to trigger emmet expand abbreviation.
|
Hi, the two commands currently work as follows:
Therefore, editor.emmet.action.expandAbbreviation is the command that should be called by the tab key press. That command should also be the one called by the suggestion box/command palette by default. |
Both methods of expansion go into visual mode for me now. Otherwise, we have the following issues:
I'm not sure how these operations should be handled without changing the selected text. |
any progress now ? |
This is still an issue in 1.21.1 in case anyone was wondering. Thanks for your work! <3 |
I still have the same issue, and it's really bothersome. |
@devstefancho I switched to amVim, but you can fork and comment this line Line 181 in 35d06e6
|
How to fix it |
@rehack Cool!, I install another version(1.16.0) and The problem is gone like magic. This is How to switch to another version |
This is still an issue in v1.21.6 in case anyone was wondering. Thanks for your work! |
Is there any progress now? |
Nothing update, I have go back to neovim. |
Perhaps this just needs to be reassigned? @berknam seems to not be very active anymore. Considering that we've identified the commit that caused this issue in this comment, perhaps the fix is straightforward? As far as I can tell this is still an issue in the latest version of the extension. @J-Fields any chance this could get re-prioritized? The label seems to suggest that this is an upstream issue, but it seems doubtful if there are version of the Vim extension that work and ones that do not. |
It might be worth a try, but I have the following Emmet settings right now and I can use the abbreviations without getting shoved into visual mode. I had the same problem as everyone else until I added the
|
您好!您的邮件已经收到,我会及时回复您,感谢您对睿客网的支持。需了解更多高质量的web开发技术请移步:http://www.rehack.cn/
|
I had faced the same issue (with
Here's my full settings file in case you wanna replicate it: {
"editor.fontSize": 16,
"workbench.colorTheme": "Cobalt2",
"editor.bracketPairColorization.enabled": true,
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
"editor.guides.bracketPairs": true,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": true,
"editor.tabSize": 2,
"editor.fontFamily": "'Fira Code', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.copyWithSyntaxHighlighting": false,
"emmet.includeLanguages": {
"erb": "html",
"html": "html",
"html.erb": "html",
"ruby": "html",
"html.inky": "html"
},
"emmet.triggerExpansionOnTab": true,
"emmet.showExpandedAbbreviation": "always",
"workbench.iconTheme": "vscode-great-icons",
"auto-close-tag.fullMode": true,
"editor.minimap.enabled": false,
"files.associations": {
"*.erb": "erb",
"Gemfile": "ruby"
}
} And the extensions I have installed: * Most of them are not related to the issue, but may be worth mention it. |
Can confirm this is still an issue in Vim (
As mentioned in the comment above, I had the same settings but was not able to get it to work. |
I'm experimenting with this issue right now (locally in my settings), and I've noticed that this abomination of a custom keybinding actually seems to produce the desired effect. I simply tried recreating the steps I usually do manually to counteract this issue ( "vim.insertModeKeyBindingsNonRecursive": [
{
"before": ["<C-e>"],
"after": [],
"commands": [
{
"command": "editor.emmet.action.expandAbbreviation",
"args": []
},
{
"command": "extension.vim_escape",
"args": []
},
{
"command": "extension.vim_insert",
"args": []
},
{
"command": "extension.vim_right",
"args": []
},
{
"command": "extension.vim_right",
"args": []
},
{
"command": "extension.vim_right",
"args": []
}
]
}
] |
This issue is still relevant. I modified a bit @mrwest808 solution to be able to handle more scenarios with a simple repeated keystroke: {
"vim.insertModeKeyBindingsNonRecursive": [
{
"before": ["<C-m>"],
"after": [],
"commands": [
{
"command": "editor.emmet.action.expandAbbreviation",
"args": []
},
{
"command": "extension.vim_escape",
"args": []
}
]
},
...
],
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<C-m>"],
"after": ["f", "/", "h", "i"]
},
...
],
...
} It will map the C-m key combination (C-m is more ergonomic for me) in both insert mode and in normal mode:
You just have to press C-m twice, and you are golden 👯 I cannot found a solution to do it with one mapping as With this double mapping you can have more complex
|
Any update? |
Describe the bug
When
emmet.triggerExpansionOnTab
is triggered viaTAB
, the editor enters visual mode.To Reproduce
.html
file.div
.Tab
.Expected behavior
The editor should remain in insert mode.
Screenshots
Environment (please complete the following information):
Additional context
Related to: #5474
The PR referenced in the issue above did not fix the issue.
The text was updated successfully, but these errors were encountered: