【发布时间】:2017-01-24 07:47:15
【问题描述】:
如何在 Visual Studio Code 中(不在 Visual Studio 中)显示换行符(CR、LF)?
目前只有小状态栏菜单显示/更改实际文件的行尾。但有时在每一行中直接看到行尾会很棒,尤其是当有混合行尾时(不好,但这种情况时有发生)。
我使用以下设置,但没有一个显示行尾。
"editor.renderWhitespace": true,
"editor.renderControlCharacters": true,
"editor.renderIndentGuides": true
是否有行尾设置?
我在 GitHub 上打开了一个问题:Possibility to display line endings in text area #12223
Soham Kamani 对此进行了扩展:code-eol
【问题讨论】:
-
我已经为此做了一个扩展,以防你仍然需要它:marketplace.visualstudio.com/…
-
@SohamKamani 您的评论应该是问题的公认答案。
-
那个扩展是没用的:它实际上并不显示字符是回车符还是换行符,它只是在与 vscode 所说的文件相匹配的行末尾生成字形。它无助于查明具有混合行尾样式的文件。 (或者 vscode 会自动对文件的 EOL 进行规范化,因此对此效果的任何扩展都是无用的。)
-
这已经改变了:“editor.renderWhitespace”: true, true 不再被接受。
-
对于“editor.renderWhitespace”的有效值:“none”、“boundary”、“selection”、“trailing”、“all”作为字符串。