diff options
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 1 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTestProto.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 26eb7e1bd4b..41a42d1e60e 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -725,6 +725,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State, AvoidBinPacking = Current.BlockKind == BK_Block || Current.Type == TT_ArrayInitializerLSquare || Current.Type == TT_DictLiteral || + Style.Language == FormatStyle::LK_Proto || !Style.BinPackParameters || (NextNoComment && NextNoComment->Type == TT_DesignatedInitializerPeriod); diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp index b3dd354b2c9..a448e220c1c 100644 --- a/clang/unittests/Format/FormatTestProto.cpp +++ b/clang/unittests/Format/FormatTestProto.cpp @@ -88,6 +88,10 @@ TEST_F(FormatTestProto, MessageFieldAttributes) { verifyFormat("repeated double value = 1\n" " [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA\n" " bbbbbbbbbbbbbbbb: BBBBBBBBBB}];"); + verifyFormat("repeated double value = 1\n" + " [(aaaaaaa.aaaaaaaaa) = {aaaaaaaaaaaaaaaa: AAAAAAAAAA,\n" + " bbbbbbb: BBBB,\n" + " bbbb: BBB}];"); } TEST_F(FormatTestProto, FormatsOptions) { |