Reputation: 660
I'm looking for a way to conditionally set the opening brace on a newline only after the statement that preceded it spanned multiple lines.
For example
void foo() { // single line
}
void bar(int aaaaaaaaaaaaaaaaaaaa
int bbbbbbbbbbbbbbbbbbbb)
{ // declaration of bar spanned multiple lines, brace on newline.
}
for (int i = 0;
i < 10; ++i)
{ // for loop spanned multiple lines, so brace on newline.
}
Is there any rule that allows this in clang format? I can't seem to find one.
Upvotes: 4
Views: 418
Reputation: 497
.clang-format
BraceWrapping:
AfterControlStatement: MultiLine
Upvotes: 1