Those empty lines waste vertical whitespace and almost never
increase readability.
Before:
void f() {
DoSomething();
}
After:
void f() {
DoSomething();
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173785
91177308-0d34-0410-b5e6-
96231b3b80d8
Style.MaxEmptyLinesToKeep + 1);
if (Newlines == 0 && !Tok.IsFirst)
Newlines = 1;
+ if (Tok.Tok.is(tok::r_brace) && Newlines > 1)
+ Newlines = 1;
unsigned Indent = Level * 2;
bool IsAccessModifier = false;
TEST_F(FormatTest, FormatsNestedBlockStatements) {
EXPECT_EQ("{\n {\n {}\n }\n}", format("{{{}}}"));
+ EXPECT_EQ("{\n {\n {}\n }\n}", format("{{{}}\n\n}"));
}
TEST_F(FormatTest, FormatsNestedCall) {