================
@@ -3551,18 +3568,21 @@ static void sortCppIncludes(const FormatStyle &Style,
   const auto OldCursor = Cursor ? *Cursor : 0;
   std::string result;
   for (unsigned Index : Indices) {
+    const auto NewCategory = Includes[Index].Category;
     if (!result.empty()) {
       result += "\n";
       if (Style.IncludeStyle.IncludeBlocks ==
               tooling::IncludeStyle::IBS_Regroup &&
-          CurrentCategory != Includes[Index].Category) {
-        result += "\n";
+          CurrentCategory != NewCategory) {
+        const int EmptyLineCount = GetEmptyLines(CurrentCategory, NewCategory);
----------------
HazardyKnusperkeks wrote:

You can just get the `EmptyLines` by using the `Index`, no?

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

Reply via email to