我尝试对齐某些分配以提高可读性,但每次粘贴内容时,Visual Studio 2013会自动删除=
之前的额外空格。
例如,这个:
static class Constants {
public static string Something = "A value";
public static string SomethingElse = "Another value";
}
重新格式化如下:
static class Constants {
public static string Something = "A value";
public static string SomethingElse = "Another value";
}
有没有办法将其关闭?
答案 0 :(得分:8)
可以在Tools->Options->Text Editor->C#->Formatting->Spacing
中通过"忽略声明中的空格"来关闭它。选项。
答案 1 :(得分:3)
VB.net for VisualStudio 2016 instructions:
|<-- main menu bar -->|<------------Side Panel Of Options Window------>|
Tools --> Options --> | Text Editor v | --> | Basic v | --> | Advanced |
Options.Advanced window:
=========================================================
= +----Highlighting-------------------------------+ =
= | (...) | =
= +-----------------------------------------------+ =
= =
= +----Outlining----------------------------------+ =
= | (...) | =
= +-----------------------------------------------+ =
= =
= +----Editor Help--------------------------------+ =
= | | =
= | [ ] Pretty listing (reformatting) of code | =
= | | =
= +-----------------------------------------------+ =
=========================================================