[clang] [clang-format] Respect definition separators when MaxEmptyLinesToKeep: 0 (PR #206406)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 30 12:03:54 PDT 2026


================
@@ -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);
+
----------------
HazardyKnusperkeks wrote:

`SeparateDefinitionBlocks` is handled in `DefinitionBlockSeparator.cpp` I think you should try to fix it there.

https://github.com/llvm/llvm-project/pull/206406


More information about the cfe-commits mailing list