-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Bug in cursor location within user snippets #11742
Comments
@richardruiter I tried in OS X El Capitan 10.11.6 and Windows 10 with VS Code 1.5.1 and can't repro this. The cursor ends up in the right place. Are you able to see this when extensions are disabled? Try running @jrieken Assigning to you since you were the last person touching the snippets side of things as far as I know |
same here - failing to reproduce. @richardruiter Please update your steps/sample |
This very annoying bug happens on my machine too. |
@ITSecMedia It would help if you include reproducible steps and the snippet you are completing |
Sorry, I expected the bug is obvious. Just opened VSCode, started new markdown file using this snippet. The defined tab-stops in the snippets doesn't work anymore. When I have a text like this. example [example](sc <-shortcode) example example example CURSOR HERE The cursor is not placed at position $1 inside the placed snippet but rather at the end of line.
|
Thanks. I can reproduce now |
As a workaround you can use tab completion (settings > |
On my machine the bug occurs no matter if |
Hello, i have the same issue, but on every snippets that I downloaded (angular 1, 2 html and my custom snippets). |
That's likely because the completion window eats the tab (instead of the tab controller). Try to also hide snippets from the suggest window (only tab completion) |
My above workaround isn't valid - this only works when you are at column: 1 or with multiline snippets. I have pushed a fix now |
To verify
|
@jrieken, hmm, broken cases (with your fix): {
"after": {
"prefix": "aftr",
"body": [
"afterEach((done) => {",
"\t${1}test",
"});"
],
"description": "Mocha BDD: after() | afterEach()"
}
} {
"after": {
"prefix": "aftr",
"body": [
"afterEach((done) => {",
"${1}\ttest",
"});"
],
"description": "Mocha BDD: after() | afterEach()"
}
} |
@mrmlnc This is with version what? |
I'll take a look |
While fixing this I encountered a bigger underlying problem which is a more complex... Needs more thinking or we revert the change (simple snippets for multiple cursors) for 1.5 and revisit for Sept |
Hello, I am still having the issue same with #11782, cursor is not between quotes after autocomplete on HTML. I just updated to VS Code version 1.5.1, and using Windows 7. I am new here so if you need additional information from me, please advice. |
@cauldyclark15 You need to wait for 1.5.2 or built from source |
@jrieken Thank you for your response, I understand now. |
Since this fix for some reason snippets only work once |
Still seeing the above issue |
@dburles I am able to confirm that the issue described above in #11742 (comment) and #11742 (comment) are working as expected. Are you referring to these linked issues or your earlier comment of "snippets only work once" ? |
Sorry yeah the issue with snippets only working once. It's a strange one and I just haven't had time to dig into it. Basically I'll be able to write 'log[tab]' and have it expand to |
@dburles Can you create a new issue for that since this issue is more about the cursor position after snippet expansion? |
Sure. Though I do recall that it wasn't a problem until this fix was released so it's possibly related. |
@dburles In that case, do add a note about it in the new issue. Thanks! |
This used to be an issue on osx, primarily with HTML files, this occurred right after a certain release of vscode, I think 1.7.0, but an update to 1.7.1 fixed it, I'm guessing Windows didn't get the same fix |
I have the same problem too, snippets only work for $1 and the it skip all next to the end of the snippet, if you've set $0, it will be $1 -> $0, all others will be skipped too. Both on Windows( my version is enterprise 10) and Ubuntu ( 16.04.2). |
Steps to Reproduce:
Before the update of 1.5.0 the cursor appeared at $1
console.log('|');
now at the end of the lineconsole.log('');|
The text was updated successfully, but these errors were encountered: