阻止 Visual Studio 2013 自动删除作业中的多余空格
Stop Visual Studio 2013 from automatically removing extra spaces in assignments
我试图对齐一些作业以提高可读性,但每次我粘贴内容时,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";
}
有没有办法关闭它?
这可以在 Tools->Options->Text Editor->C#->Formatting->Spacing
中通过 "Ignore spaces in declaration statements" 选项关闭。
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 | =
= | | =
= +-----------------------------------------------+ =
=========================================================
屏幕截图:
我试图对齐一些作业以提高可读性,但每次我粘贴内容时,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";
}
有没有办法关闭它?
这可以在 Tools->Options->Text Editor->C#->Formatting->Spacing
中通过 "Ignore spaces in declaration statements" 选项关闭。
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 | =
= | | =
= +-----------------------------------------------+ =
=========================================================
屏幕截图: