如何防止VS Code将较长的HTML行分成多行? [英] How to prevent VS Code from breaking up long HTML lines into multiple lines?

查看:249
本文介绍了如何防止VS Code将较长的HTML行分成多行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的带有属性的元素变长时,VS Code似乎将行分成多行:

When my elements with attributes get long, VS Code seems to break the line up into multiple lines:

(我想要三行而不是七行,每个元素一行)

(I would like three lines here instead of seven, one line per element)

我正在使用更漂亮的格式,并设置了在JavaScript代码中可用的printWidth选项,但对于HTML,它似乎已被VS Code覆盖.

I am using prettier for formatting, and have set the printWidth option which works in javascript code, but for HTML it seems to be overridden by VS Code.

我尝试摆弄wrapAttributeshtml.format.wrapLineLength设置,但似乎没有任何作用.

I´ve tried fiddling around with the wrapAttributes and the html.format.wrapLineLength settings, but none of those seem to have any effect.

如何处理此事?

推荐答案

您可以在settings.json中添加"html.format.wrapLineLength": 0.

You can add "html.format.wrapLineLength": 0 in settings.json.

这篇关于如何防止VS Code将较长的HTML行分成多行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆