Fix aligning of comments that are at the start of the line.
Now correctly leaves: f(); // comment // comment g(); // comment ... alone if the middle comment was aligned with g() before formatting. llvm-svn: 182605
This commit is contained in:
@@ -170,9 +170,10 @@ void WhitespaceManager::alignTrailingComments() {
|
||||
MinColumn = std::max(MinColumn, ChangeMinColumn);
|
||||
MaxColumn = std::min(MaxColumn, ChangeMaxColumn);
|
||||
}
|
||||
BreakBeforeNext =
|
||||
(i == 0) || (Changes[i].NewlinesBefore > 1) ||
|
||||
(Changes[i].NewlinesBefore == 1 && !Changes[i - 1].IsTrailingComment);
|
||||
BreakBeforeNext = (i == 0) || (Changes[i].NewlinesBefore > 1) ||
|
||||
(Changes[i].NewlinesBefore == 1 &&
|
||||
!Changes[i - 1].IsTrailingComment) ||
|
||||
WasAlignedWithStartOfNextLine;
|
||||
Newlines = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user