Skip to content
Snippets Groups Projects
Commit 42f458d1 authored by Daniel Jasper's avatar Daniel Jasper
Browse files

Fix comment alignment close to the column limit.

Due to an error in one of the expressions, we used to not align comments
although it would have been possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175068 91177308-0d34-0410-b5e6-96231b3b80d8
parent 82064213
No related branches found
No related tags found
No related merge requests found
...@@ -127,7 +127,7 @@ public: ...@@ -127,7 +127,7 @@ public:
else else
Comments.back().MinColumn = Spaces; Comments.back().MinColumn = Spaces;
Comments.back().MaxColumn = Comments.back().MaxColumn =
Style.ColumnLimit - Spaces - Tok.FormatTok.TokenLength; Style.ColumnLimit - Tok.FormatTok.TokenLength;
return; return;
} }
} }
......
...@@ -465,6 +465,9 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) { ...@@ -465,6 +465,9 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) {
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaaa;"); " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaaa;");
verifyFormat("int aaaa; // aaaaa\n"
"int aa; // aaaaaaa", getLLVMStyleWithColumns(20));
EXPECT_EQ("void f() { // This does something ..\n" EXPECT_EQ("void f() { // This does something ..\n"
"}\n" "}\n"
"int a; // This is unrelated", "int a; // This is unrelated",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment