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

标签 c# visual-studio visual-studio-2013 code-formatting

我试图对齐一些分配以提高可读性,但每次我粘贴内容时,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 中关闭。

enter image description here

关于c# - 阻止 Visual Studio 2013 自动删除分配中的额外空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28834688/

相关文章:

visual-studio - Visual Studio Debugger 未在鼠标悬停时显示变量详细信息,因为它是 "out of context"

c++ - COleDateTime 模糊符号

c# - UWP - 切换到另一个文本框时屏幕键盘关闭

c# - 如何使用 C#/.NET 的反射在程序集中实例化类?

c++ - 如何设置.vcxproj以让MSBuild编译dll

c++ - 如何将 SDK 连接到 Visual Studio?

c# - 如何在 C# 中使用本地数据库?

c# - 为什么 DllImport for C bool as UnmanagedType.I1 throws but as byte it works

c# - 处理 JSON.net 中的引用循环

c# - LINQ to Lookup 具有不同的项目和计数