Skip to content

Commit

Permalink
Add missing LikelyFunctionDef call for comments
Browse files Browse the repository at this point in the history
This was accidentally removed.
  • Loading branch information
vhorvath-gs committed Jul 5, 2023
1 parent b983134 commit 612d466
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clang/lib/Format/WhitespaceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ unsigned WhitespaceManager::calculateNewlinesCountOrElse(
AnnotatedLine *NextLine = GetNextLine(CurrentLine, Lines);
if (NextLine != nullptr) {
FormatToken *Token = NextLine->First;
if (Token != nullptr && Token->NewlinesBefore == 1)
if (Token != nullptr && Token->NewlinesBefore == 1 &&
LikelyFunctionDef(*NextLine)) {
return NewlinesCount;
}
}
}

Expand Down

0 comments on commit 612d466

Please sign in to comment.