]> granicus.if.org Git - clang/commit
clang-format: Keep empty lines and format 1-line nested blocks.
authorDaniel Jasper <djasper@google.com>
Sun, 8 Sep 2013 14:07:57 +0000 (14:07 +0000)
committerDaniel Jasper <djasper@google.com>
Sun, 8 Sep 2013 14:07:57 +0000 (14:07 +0000)
commit14e25c0477bf9f51e980fdc23b7f0bff800f3ae7
tree99826e1665cdfa0fcde0d74c77c97394b4c837fc
parentc23b1db6268c8e7ce64026d57d1510c1aac200a0
clang-format: Keep empty lines and format 1-line nested blocks.

Let clang-format consistently keep up to one empty line (configured via
FormatStyle::MaxEmptyLinesToKeep) in nested blocks, e.g. lambdas. Also,
actually format single statements in nested blocks.

Before:
  DEBUG({ int     i; });
  DEBUG({
    int i;
    // an empty line here would just be removed.
    int j;
  });

After:
  DEBUG({ int i; });
  DEBUG({
    int i;

    int j;
  });

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190278 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
unittests/Format/FormatTest.cpp