We might want to move towards doing this if the formatting can be
significantly improved, but we need to carefully evaluate the different
situations first.
Before (the string literal was split by clang-format here):
aaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaa, aaaaaa("aaa aaaaa aaa aaa aaaaa aaa "
"aaaaa aaa aaa aaaaaa"));
After:
aaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaa,
aaaaaa("aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa"));
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176084
91177308-0d34-0410-b5e6-
96231b3b80d8
TailOffset += SplitPoint + 1;
TailLength -= SplitPoint + 1;
OffsetFromStart = 1;
- Penalty += 100;
+ Penalty += Style.PenaltyExcessCharacter;
}
State.Column = StartColumn + TailLength;
return Penalty;
" \"text\",\n"
" other);",
format("f(\"some text\", other);", getLLVMStyleWithColumns(10)));
+
+ // Only break as a last resort.
+ verifyFormat(
+ "aaaaaaaaaaaaaaaaaaaa(\n"
+ " aaaaaaaaaaaaaaaaaaaa,\n"
+ " aaaaaa(\"aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa\"));");
}
} // end namespace tooling