英文:
Prevent Visual Studio Code taking new line when editing HTML tag attributes
问题
I have an annoying issue when editing HTML in VS Code. If I have an element say a button:
<button class="btn btn-success" id="myBtn" style="width: 50%"></button>
When I hit a certain number of characters on a line of code with a tag and start typing more characters into that line e.g
<button class="btn btn-success" id="myBtn" style="width: 50%">Click here</button>
VS Code will automatically separate the line and spread the tag across two lines like so:
<button class="btn btn-success" id="myBtn"
style="width: 50%">Click here</button>
I like to keep code files short when I can and this can be quite annoying when this happens as there is plenty of space on the original line above. I have tried disabling word wrap in settings, set the wrap line length for HTML to 0 etc. but the behaviour persists. How can I completely disable this from automatically happening?
英文:
I have an annoying issue when editing HTML in VS Code. If I have an element say a button:
<button class="btn btn-success" id="myBtn" style="width: 50%"></button>
When I hit a certain number of characters on a line of code with a tag and start typing more characters into that line e.g
<button class="btn btn-success" id="myBtn" style="width: 50%">Click here</button>
VS Code will automatically separate the line and spread the tag across two lines like so:
<button class="btn btn-success" id="myBtn"
style="width: 50%">Click here</button>
I like to keep code files short when I can and this can be quite annoying when this happens as there is plenty of space on the original line above. I have tried disabling word wrap in settings, set the wrap line length for HTML to 0 etc. but the behaviour persists. How can I completely disable this from automatically happening?
答案1
得分: 1
已修复。这是由于我的扩展程序导致的。Prettier 和 rewrap(我以为只用于注释)是罪魁祸首。不再自动换行了。
英文:
Fixed it. It was to due to my extensions. Prettier and rewrap (which I only thought was for comments) were the culprits here. No more auto rewrap happening anymore.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论