Prevent Visual Studio Code taking new line when editing HTML tag attributes.

huangapple go评论60阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年1月6日 17:42:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/59609769.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定