Wilbert
Wilbert

Reputation: 7399

Visual Studio C++ Code Formatting - return type + classname::func indentation

I am using Visual Studio 2012 for developing C++ code. I am used to format my code as follows:

void
SomeThing::DoesSomething()
{
    // brilliant code 
}

However, when using VS2012 code formatter, it always turns my code into this:

void 
    SomeThing::DoesSomething()
{
    // still brilliant
}

Is there a way to avoid this indentation of the ClassName::Func() in the line below the return type without completely turning off auto indentation?

Upvotes: 9

Views: 803

Answers (1)

Oleksiy
Oleksiy

Reputation: 39790

This is as close as you can get to your desired settings:

Tools -> Options -> Text Editor -> C/C++ -> Tabs -> Indenting -> Block

It doesn't turn off indentation (when you are coding at 1 tab and press enter, it will still be at 1 tab), but it stops it from indenting things for you.

Hope this helps!

Upvotes: 3

Related Questions