阻止Visual Studio 2013自动删除分配中的额外空格

Pao*_*sco 4 c# code-formatting visual-studio visual-studio-2013

我正在尝试对齐某些赋值以提高可读性,但每次粘贴时,Visual Studio 2013会自动删除多余的空格=.

例如,这个:

static class Constants {
    public static string Something      = "A value";
    public static string SomethingElse  = "Another value";
}
Run Code Online (Sandbox Code Playgroud)

像这样重新格式化:

static class Constants {
    public static string Something = "A value";
    public static string SomethingElse = "Another value";
}
Run Code Online (Sandbox Code Playgroud)

有没有办法把它关掉?

Cam*_*ron 8

可以Tools->Options->Text Editor->C#->Formatting->Spacing通过"忽略声明语句中的空格"选项关闭它.

在此输入图像描述