]> granicus.if.org Git - clang/commit
clang-format: Improve nested block / lambda indentation when wrapping
authorDaniel Jasper <djasper@google.com>
Wed, 13 May 2015 16:09:21 +0000 (16:09 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 13 May 2015 16:09:21 +0000 (16:09 +0000)
commitcd67166a3795b74c801fcfc99b83e870356344e9
tree90e8af3db4d42efbaed48d6d90ceefee59ea545b
parent9eea8caa35cc9a5170916a71b79de44524f62c7b
clang-format: Improve nested block / lambda indentation when wrapping
before binary/ternary operators.

Basically, it doesn't seem right to indent a nested block aligned to a
binary or ternary operator.

Before:
  int i = aaaaaa ? 1  //
                 : [] {
                   return 2;  //
                 }();
  llvm::errs() << "number of twos is "
               << std::count_if(v.begin(), v.end(), [](int x) {
                 return x == 2;  // force break
               });

After:
  int i = aaaaaa ? 1  //
                 : [] {
                     return 2;  //
                   }();
  llvm::errs() << "number of twos is "
               << std::count_if(v.begin(), v.end(), [](int x) {
                    return x == 2;  // force break
                  });

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