clang-format: Slightly adapt line break in edge case.
Before: SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)] .insert(ccccccccccccccccccccccc); After: SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)].insert( ccccccccccccccccccccccc); This seems to be about 3:1 more common in Google and Chromium style and I found only a handful of instances inside the LLVM codebase. llvm-svn: 198924
This commit is contained in:
parent
73cb84c271
commit
4d7a97adfc
|
@ -1203,7 +1203,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
|
|||
return 2;
|
||||
|
||||
if (Right.isMemberAccess()) {
|
||||
if (Left.isOneOf(tok::r_paren, tok::r_square) && Left.MatchingParen &&
|
||||
if (Left.is(tok::r_paren) && Left.MatchingParen &&
|
||||
Left.MatchingParen->ParameterCount > 0)
|
||||
return 20; // Should be smaller than breaking at a nested comma.
|
||||
return 150;
|
||||
|
|
|
@ -3910,8 +3910,8 @@ TEST_F(FormatTest, WrapsAtFunctionCallsIfNecessary) {
|
|||
|
||||
verifyFormat("EXPECT_CALL(SomeObject, SomeFunction(Parameter))\n"
|
||||
" .WillRepeatedly(Return(SomeValue));");
|
||||
verifyFormat("SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)]\n"
|
||||
" .insert(ccccccccccccccccccccccc);");
|
||||
verifyFormat("SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)].insert(\n"
|
||||
" ccccccccccccccccccccccc);");
|
||||
verifyFormat("aaaaa(aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa).aaaaa(aaaaa),\n"
|
||||
" aaaaaaaaaaaaaaaaaaaaa);");
|
||||
|
|
Loading…
Reference in New Issue