forked from OSchip/llvm-project
clang-format: Less eagerly try to keep label-value pairs on a line.
Before: string v = StrCat("aaaaaaaaaaaaaaaaaaaaaaaaaaa: ", SomeFunction(aaaaaaaaaaaa, aaaaaaaaaaaaaaa), bbbbbbbbbbbbbbbbbbbbbbb); After: string v = StrCat("aaaaaaaaaaaaaaaaaaaaaaaaaaa: ", SomeFunction(aaaaaaaaaaaa, aaaaaaaaaaaaaaa), bbbbbbbbbbbbbbbbbbbbbbb); llvm-svn: 290337
This commit is contained in:
parent
a6792a39c4
commit
2388861f09
|
@ -2001,7 +2001,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
|
|||
if (Left.isOneOf(tok::plus, tok::comma) && Left.Previous &&
|
||||
Left.Previous->isLabelString() &&
|
||||
(Left.NextOperator || Left.OperatorIndex != 0))
|
||||
return 100;
|
||||
return 45;
|
||||
if (Right.is(tok::plus) && Left.isLabelString() &&
|
||||
(Right.NextOperator || Right.OperatorIndex != 0))
|
||||
return 25;
|
||||
|
|
|
@ -5220,6 +5220,10 @@ TEST_F(FormatTest, KeepStringLabelValuePairsOnALine) {
|
|||
verifyFormat("string v = StrCat(\"aaaaaaaaaaaa: \" +\n"
|
||||
" (aaaaaaa + aaaaa));",
|
||||
getLLVMStyleWithColumns(40));
|
||||
verifyFormat(
|
||||
"string v = StrCat(\"aaaaaaaaaaaaaaaaaaaaaaaaaaa: \",\n"
|
||||
" SomeFunction(aaaaaaaaaaaa, aaaaaaaa.aaaaaaa),\n"
|
||||
" bbbbbbbbbbbbbbbbbbbbbbb);");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, UnderstandsEquals) {
|
||||
|
|
Loading…
Reference in New Issue