[clang] [clang-format] Allow array alignment on non-rectangular arrays (PR #143781)
Ben Dunkin via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 11 11:20:27 PDT 2025
================
@@ -278,6 +278,33 @@ void WhitespaceManager::calculateLineBreakInformation() {
}
}
+// Sets the spaces in front of a Change, and updates the start/end columns of
+// subsequent tokens so that trailing comments and escaped newlines can be
+// aligned properly
+static void
+SetChangeSpaces(unsigned Start, unsigned Spaces,
----------------
bdunkin wrote:
Updating `Spaces`, without also modifying `PreviousEndOfTokenColumn` for the next token means the spaces are not considered when aligning trailing comments or preprocessor line breaks. I changed all places in this file that modified `Spaces` directly to use this function instead.
https://github.com/llvm/llvm-project/pull/143781
More information about the cfe-commits
mailing list