================
@@ -1633,8 +1633,16 @@ static auto computeNewlines(const AnnotatedLine &Line,
                             const SmallVectorImpl<AnnotatedLine *> &Lines,
                             const FormatStyle &Style) {
   const auto &RootToken = *Line.First;
-  auto Newlines =
-      std::min(RootToken.NewlinesBefore, Style.MaxEmptyLinesToKeep + 1);
+
+  unsigned MaxNewlines = Style.MaxEmptyLinesToKeep + 1;
+  if (Style.SeparateDefinitionBlocks == FormatStyle::SDS_Always &&
+      RootToken.NewlinesBefore > 1 && PreviousLine &&
+      !RootToken.is(tok::l_brace) && Line.MightBeFunctionDecl &&
----------------
HazardyKnusperkeks wrote:

```suggestion
      RootToken.isNot(tok::l_brace) && Line.MightBeFunctionDecl &&
```

https://github.com/llvm/llvm-project/pull/206406
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to