如何在 Visual Studio 代码中显示完整的长行(自动换行) [英] How to show full long line in visual studio code (word wrap off)

查看:31
本文介绍了如何在 Visual Studio 代码中显示完整的长行(自动换行)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够在 Visual Studio 代码中查看完整的长行(在单行上).编辑器以 ... 结尾来终止该行.

I want to be able to view complete long line (on a single line) in visual studio code. The editor is terminating the line with ... at the end.

我可以按 End 键移动到该行的最后一列,但它在视口中不可见.

I can press the End key to move to the last column of the line but its not visible in the viewport.

是否有任何选项可以像在 Sublime Text 或 Notepad++ 中那样查看完整的长行?

Is there any option to be able to view complete long lines like we can in Sublime Text or Notepad++?

推荐答案

答案在 这个 GitHub 问题:

当前的建议是如果意图打开自动换行是编辑超过 10k 限制或通过隐藏"更改限制通过设置等于 10000 的editor.stopRenderingLineAfter"默认,但可以更改为 -1 以永不停止渲染.但然后可能会发生冻结/滞后.

The current recommendation is to turn on word wrapping if the intent is to edit past the 10k limit or change the limit via the "hidden" setting "editor.stopRenderingLineAfter" which is equal to 10000 by default, but which can be changed to -1 to never stop rendering. But then freezes/lagging might occur.

换句话说,使用 CTRL + SHIFT + P 打开命令面板,选择 Preferences: Open Settings (JSON),并添加以下行:

In other words, use CTRL + SHIFT + P to open up the Command Palette, select Preferences: Open Settings (JSON), and add the following line:

"editor.stopRenderingLineAfter" : -1

如果您想设置硬限制,只需将 -1 更改为您想要的任何字符数.请注意,如果您没有禁用它,您可能仍然会发生换行,您可以使用 ALT + Z 或使用 这篇 Stack Overflow 帖子.

If you want to set a hard limit just change the -1 to whatever number of characters you want. Note that you might still get wrapping happening if you haven't disabled it, which you can toggle with ALT + Z or using the other methods mentioned in this Stack Overflow post.

这篇关于如何在 Visual Studio 代码中显示完整的长行(自动换行)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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