visual-studio-code - Visual Studio Code 上的 "Intelligent"自动换行

标签 visual-studio-code word-wrap vscode-settings

我对必须在 VScode 上水平滚动感到非常恼火,所以我设置了以下设置以启用自动换行:

"editor.wordWrap": "on",
"editor.wrappingIndent": "indent"

但是,我发现它包装在我不想要的地方很烦人,例如,对于像这样的函数调用:

myLongNameFunc(longNameVarA, longNameVarB);

它是这样包装的,用分号分割:

myLongNameFunc(longNameVarA, longNameVarB)
    ;

我宁愿看到这样的东西:

myLongNameFunc(longNameVarA, 
    longNameVarB);

是否可以通过某种方式设置此配置?例如,如果可能,允许它在空格上换行?

谢谢,

最佳答案

已经有一段时间了......但我看到 v1.42 将有一个新的包装策略选项,它为我修复了你的例子:

Editor: Wrapping Strategy

选择高级

Controls the algorithm that computes wrapping points.

  • simple: Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.

  • advanced: Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.

正如设置警告,advanced 可能会对大文件产生不利影响,但它确实正确地包装了您的示例。

关于visual-studio-code - Visual Studio Code 上的 "Intelligent"自动换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47534848/

相关文章:

visual-studio-code - 为 VS Code/ts-node/ts-node-dev 指定备用 tsconfig.json

python - 函数 open() 在 Visual Studio Code 中不起作用

ubuntu - 在 ubuntu linux 中以 root 权限运行 VS Code 不再起作用

html - CSS 自动换行不适用于 <a> 标签

word-wrap - 斑马 ZPL 换行文本

text - 如何在 QML 的矩形中包装一些文本?

visual-studio-code - 我无法连接到 Visual Studio Code 的扩展市场

visual-studio-code - VS Code 1.3 重新启用 Markdown 预览

visual-studio-code - VS Code 调试器到达第一个断点的速度极慢

python - 如何运行当前行并在 VS Code 中前进? ( window )