Max_S added inline comments.

================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:1284
       (!PreviousLine->InPPDirective || !RootToken.HasUnescapedNewline))
-    Newlines = std::min(1u, Newlines);
+    Newlines = Style.EmptyLinesAfterAccessModifier + 1u;
 
----------------
HazardyKnusperkeks wrote:
> I don't know, I'm just asking:
> Shouldn't this be `Newlines = std::min(Newlines, 
> Style.EmptyLinesAfterAccessModifier + 1u);`?
This is also possible but then the logic would be how many lines should be kept 
at maximum after an access specifier.

The name would then be `Style.KeepMaximumLinesAfterAccessModifier`.

Currently the logic above:
```
  if (Newlines == 0 && !RootToken.IsFirst)
    Newlines = 1;
```
forces Newlines to be always 1 or bigger. Therefore the old logic would always 
add one new line and I decided to implement the setting in the same way.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98237/new/

https://reviews.llvm.org/D98237

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to