简体   繁体   中英

VS Code cursor in wrong position after tab

When I write some code, and then click Tab to autofill from context menu the cursor is now in the wrong position. It should be before ";"but for some reason it is after ";". Worked fine for about a year, and now suddenly something like this, any ideas?

1

This problem is related to snippets in vscode.

The easiest way to solve this is to use the snippet extension.

Install " HTML CSS Support " extension made by " ecmel " to visual studio code. Close the program and open it again and you are ready. Problem fixed.

Extension URL: https://marketplace.visualstudio.com/items?itemName=ecmel.vscode-html-css

Long way: You can write your own or update snippets, to solve this.

Documentation to make your own snippets: https://code.visualstudio.com/docs/editor/userdefinedsnippets

I had same issue. I tried all of the solution proposals and searched snippets for it but can't found anything. I was already using the html css support extension by ecmel. I deleted and reinstalled it, Closed the vscode program and open it again but I couldn't get any results. Finally downgraded vscode to 1.64 version from here and now cursor works like a charm. I wanted to write this answer for friends like me who did not get any results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM