From aa94a90a79d2febcb2846ffa513bae148b88810f Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Tue, 29 Jan 2013 09:42:11 +0000 Subject: Remove empty lines before "}". Those empty lines waste vertical whitespace and almost never increase readability. Before: void f() { DoSomething(); } After: void f() { DoSomething(); } llvm-svn: 173785 --- clang/lib/Format/Format.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Format/Format.cpp') diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 8eebda0740b..58e6648ca30 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1990,6 +1990,8 @@ private: 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; -- cgit v1.2.3