Indentation to match Google style guide in indent to bracket mode

Peter Hawkins 6 years ago • updated by Luc Bourhis 6 years ago 1

I'd like to write code matching Google's C++ style guide:


Indent to bracket mode supports this style already:

ReturnType ClassName::ReallyLongFunctionName(Type par_name1, Type par_name2,
                                             Type par_name3) {

In the event that the parameters are too long to fit on the line, I'd like to use this style:

ReturnType LongClassName::ReallyReallyReallyLongFunctionName(
    Type par_name1,  // 4 space indent
    Type par_name2,
    Type par_name3) {
  DoSomething();  // 2 space indent

I second that. Actually XCode has the same issue: typing "enter" after an open parenthesis move the cursor vertically in the same column and one is then forced to hit "backspace" a few times to get the second layout in Peter's message. And since one never knows how many time backspace has to be hit, this gets rather cumbersome.