Index: cfe/trunk/lib/Format/ContinuationIndenter.cpp =================================================================== --- cfe/trunk/lib/Format/ContinuationIndenter.cpp +++ cfe/trunk/lib/Format/ContinuationIndenter.cpp @@ -200,6 +200,7 @@ // global scope. State.Stack.back().AvoidBinPacking = true; State.Stack.back().BreakBeforeParameter = true; + State.Stack.back().AlignColons = false; } // The first token has already been indented and thus consumed. Index: cfe/trunk/unittests/Format/FormatTestTextProto.cpp =================================================================== --- cfe/trunk/unittests/Format/FormatTestTextProto.cpp +++ cfe/trunk/unittests/Format/FormatTestTextProto.cpp @@ -313,5 +313,17 @@ " text: \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasaaaaaaaaaa\"\n" "}"); } + +TEST_F(FormatTestTextProto, KeepsCommentsIndentedInList) { + verifyFormat("aaaaaaaaaa: 100\n" + "bbbbbbbbbbbbbbbbbbbbbbbbbbb: 200\n" + "# Single line comment for stuff here.\n" + "cccccccccccccccccccccccc: 3849\n" + "# Multiline comment for stuff here.\n" + "# Multiline comment for stuff here.\n" + "# Multiline comment for stuff here.\n" + "cccccccccccccccccccccccc: 3849"); +} + } // end namespace tooling } // end namespace clang