diff options
author | Daniel Jasper <djasper@google.com> | 2015-04-24 10:08:09 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-04-24 10:08:09 +0000 |
commit | 775954be1ee9bae06c5629d861d1756b23c3589c (patch) | |
tree | 9570b9ecba2771b3a35d7796ed1c97c2fcba043c /clang/lib/Format | |
parent | 87d935dd0917f5460dfc737b143c3e59e7ac64a6 (diff) | |
download | bcm5719-llvm-775954be1ee9bae06c5629d861d1756b23c3589c.tar.gz bcm5719-llvm-775954be1ee9bae06c5629d861d1756b23c3589c.zip |
clang-format: Don't wrap after short first segments of builder calls.
Before:
a()
.aaaaa()
.aaaaa()
.aaaaa();
After:
a().aaaaa()
.aaaaa()
.aaaaa();
llvm-svn: 235707
Diffstat (limited to 'clang/lib/Format')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index b03a99a248b..9e1014e5670 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -319,7 +319,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, State.Stack.back().Indent = State.Column + Spaces; if (State.Stack.back().AvoidBinPacking && startsNextParameter(Current, Style)) State.Stack.back().NoLineBreak = true; - if (startsSegmentOfBuilderTypeCall(Current)) + if (startsSegmentOfBuilderTypeCall(Current) && + State.Column > getNewLineColumn(State)) State.Stack.back().ContainsUnwrappedBuilder = true; if (Current.is(TT_LambdaArrow)) |