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.
.clang-format
BraceWrapping:
AfterControlStatement: MultiLine
Feature proposal and merged
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