diff options
-rw-r--r-- | lib/Format/TokenAnnotator.cpp | 2 | ||||
-rw-r--r-- | unittests/Format/FormatTest.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index e6aa61dddb..516aaebe6a 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -1309,7 +1309,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, if (Style.Language == FormatStyle::LK_Proto) return 1; if (Right.Type != TT_ObjCMethodExpr) - return 250; + return 500; } if (Right.Type == TT_StartOfName || Right.is(tok::kw_operator)) { if (Line.First->is(tok::kw_for) && Right.PartOfMultiVariableDeclStmt) diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index baf05a9b74..a923e1a9f8 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -5110,6 +5110,10 @@ TEST_F(FormatTest, FormatsArrays) { verifyGoogleFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<int>\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaa];"); + verifyFormat( + "aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0]\n" + " .aaaaaaa[0]\n" + " .aaaaaaaaaaaaaaaaaaaaaa();"); } TEST_F(FormatTest, LineStartsWithSpecialCharacter) { |