Visual Studio 2010 中的 C++ 访问修饰符自动缩进慢慢让我发疯 - 可以更改吗?

2023-03-09C/C++开发问题
0

本文介绍了Visual Studio 2010 中的 C++ 访问修饰符自动缩进慢慢让我发疯 - 可以更改吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

在 Visual Studio 中编程 C++ 时,它坚持在访问修饰符上给我这些可怕的缩进 - 如果有人真的喜欢这种方式,我表示哀悼;)(开玩笑的伙计们!)

When programming C++ in Visual Studio, it insists on giving me these awful indentations on access modifiers - my condolences if anyone actually likes them this way ;) (a joke folks!)

public class MyClass
{
public:
   MyClass();
   ~MyClass();
   int wowAnInt();
}

不用说,我想要这个:

public class MyClass
{
    public:
       MyClass();
       ~MyClass();
       int wowAnInt();
} 


有什么方法可以使用任何东西(我有 ReSharper 和 Highlighter)或香草 VS 来实现这一点?


Is there any way to achieve this using anything (I've got ReSharper and Highlighter) or perhaps vanilla VS?

推荐答案

与内置的 Visual Studio 编辑器设置最接近的是将缩进模式从智能"更改为块"(工具 -> 选项-> 文本编辑器 -> C/C++ -> 制表符 -> 缩进).

The closest you can get with the built-in Visual Studio editor settings is to change the indenting mode from "Smart" to "Block" (Tools -> Options -> Text Editor -> C/C++ -> Tabs -> Indenting).

当你这样做时,你可以随意缩进任何你喜欢的东西,你只是失去了自动缩进".基本上,每当您按 [enter] 时,新行都会缩进与前一行相同数量的制表位/空格,并且不会自动重新格式化行以使它们对齐.

When you do this, you can indent anything however you like, you just lose the "automatic indenting." Basically, whenever you press [enter] the new line will be indented the same number of tab stops / spaces as the previous line and it won't automatically reformat lines to get them to line up.

这篇关于Visual Studio 2010 中的 C++ 访问修饰符自动缩进慢慢让我发疯 - 可以更改吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6