diff options
author | Daniel Jasper <djasper@google.com> | 2015-03-26 18:46:28 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-03-26 18:46:28 +0000 |
commit | 05cd92922d1f1b3a21834931637704c448080ede (patch) | |
tree | 782a76cd0bd4ff46f9fff748fd00b598510d3e8c /clang/lib/Format/ContinuationIndenter.cpp | |
parent | 4c8713969ccdefd3ee6574636ca326de73e45d88 (diff) | |
download | bcm5719-llvm-05cd92922d1f1b3a21834931637704c448080ede.tar.gz bcm5719-llvm-05cd92922d1f1b3a21834931637704c448080ede.zip |
clang-format: Force line break in trailing calls after multline exprs.
Before:
aaaaaaaa(aaaaaaaaaa,
bbbbbbbbbb).a();
After:
aaaaaaaa(aaaaaaaaaa,
bbbbbbbbbb)
.a();
llvm-svn: 233304
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 9fb0efe9523..83fd6ee2497 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -221,8 +221,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { if (startsSegmentOfBuilderTypeCall(Current) && (State.Stack.back().CallContinuation != 0 || - (State.Stack.back().BreakBeforeParameter && - State.Stack.back().ContainsUnwrappedBuilder))) + State.Stack.back().BreakBeforeParameter)) return true; // The following could be precomputed as they do not depend on the state. @@ -323,6 +322,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, if (startsSegmentOfBuilderTypeCall(Current)) State.Stack.back().ContainsUnwrappedBuilder = true; + if (Current.is(TT_LambdaArrow)) + State.Stack.back().NoLineBreak = true; if (Current.isMemberAccess() && Previous.is(tok::r_paren) && (Previous.MatchingParen && (Previous.TotalLength - Previous.MatchingParen->TotalLength > 10))) { |