diff options
author | Daniel Jasper <djasper@google.com> | 2017-01-16 13:13:15 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2017-01-16 13:13:15 +0000 |
commit | 240527ca997738d755c687bf0579a65f30e4ec2e (patch) | |
tree | 1ef8f83db261449ce11e80f2d0fa12be6b91e413 /clang/lib/Format/ContinuationIndenter.h | |
parent | 52fe25053cd343b9eb8be5c2c88897e22dd6e797 (diff) | |
download | bcm5719-llvm-240527ca997738d755c687bf0579a65f30e4ec2e.tar.gz bcm5719-llvm-240527ca997738d755c687bf0579a65f30e4ec2e.zip |
clang-format: Always wrap before multi-line parameters/operands.
Before:
aaaaaaaaaaaaaaaaaa(aaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa::
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaa);
After:
aaaaaaaaaaaaaaaaaa(aaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa::
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaa);
No new test cases, as the existing ones cover this fairly well.
llvm-svn: 292110
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.h')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.h b/clang/lib/Format/ContinuationIndenter.h index 21ad653c4fa..704b2f891f7 100644 --- a/clang/lib/Format/ContinuationIndenter.h +++ b/clang/lib/Format/ContinuationIndenter.h @@ -151,10 +151,11 @@ struct ParenState { : Indent(Indent), IndentLevel(IndentLevel), LastSpace(LastSpace), NestedBlockIndent(Indent), BreakBeforeClosingBrace(false), AvoidBinPacking(AvoidBinPacking), BreakBeforeParameter(false), - NoLineBreak(NoLineBreak), LastOperatorWrapped(true), - ContainsLineBreak(false), ContainsUnwrappedBuilder(false), - AlignColons(true), ObjCSelectorNameFound(false), - HasMultipleNestedBlocks(false), NestedBlockInlined(false) {} + NoLineBreak(NoLineBreak), NoLineBreakInOperand(false), + LastOperatorWrapped(true), ContainsLineBreak(false), + ContainsUnwrappedBuilder(false), AlignColons(true), + ObjCSelectorNameFound(false), HasMultipleNestedBlocks(false), + NestedBlockInlined(false) {} /// \brief The position to which a specific parenthesis level needs to be /// indented. @@ -224,6 +225,10 @@ struct ParenState { /// \brief Line breaking in this context would break a formatting rule. bool NoLineBreak : 1; + /// \brief Same as \c NoLineBreak, but is restricted until the end of the + /// operand (including the next ","). + bool NoLineBreakInOperand : 1; + /// \brief True if the last binary operator on this level was wrapped to the /// next line. bool LastOperatorWrapped : 1; |