]> granicus.if.org Git - clang/commit
[clang-format] Fix putting ObjC message arguments in one line for multiline receiver
authorJacek Olesiak <jolesiak@google.com>
Thu, 17 May 2018 08:35:15 +0000 (08:35 +0000)
committerJacek Olesiak <jolesiak@google.com>
Thu, 17 May 2018 08:35:15 +0000 (08:35 +0000)
commitb9ed9dc4718d0eb3cda4ee6d7a9b29901e1cbc91
tree67c5117951246f0defe3505fbbff7f10415c17a5
parent96865fb14c773fbc314c0533e3286300d37ee406
[clang-format] Fix putting ObjC message arguments in one line for multiline receiver

Summary:
Currently BreakBeforeParameter is set to true everytime message receiver spans multiple lines, e.g.:
```
[[object block:^{
  return 42;
}] aa:42 bb:42];
```
will be formatted:
```
[[object block:^{
  return 42;
}] aa:42
   bb:42];
```
even though arguments could fit into one line. This change fixes this behavior.

Test Plan:
make -j12 FormatTests && tools/clang/unittests/Format/FormatTests

Reviewers: benhamilton, djasper

Reviewed By: benhamilton

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D46879

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