I would like to get this indentation when working with classes / structs:
class MyClass
{
public:
MyClass();
}
However the text formatting option only allows for either this:
class MyClass
{
public:
MyClass();
}
or that:
class MyClass
{
public:
MyClass();
}
So it only considers the access modifier itself instead of the code after it. The problem with this is that it formats it everytime wrong again when I copy/paste or just want to format existing code. Is there any way around this without manually formatting it everytime again?
It seems there is no way to do it when, under Tools->Options, Text Editor, C/C++, Tabs has Indenting set to Smart. Your class access specifiers will be automatically formatted in one of the two modes you already specified.
If you set Indenting to Block, they will be left untouched, so you're free to copy/paste your code without "smart" formatter intervention.
See: Indenting issue after access specifiers in Visual Studio Express and C++ access modifier auto indentation in visual studio 2010 slowly driving me crazy - can it be changed?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With