[PATCH] D21279: Fix some issues in clang-format's AlignConsecutive modes

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 10 01:46:32 PDT 2016

djasper added inline comments.

Comment at: lib/Format/WhitespaceManager.cpp:47
@@ +46,3 @@
+int WhitespaceManager::Change::ScopeLevel() const {
+  // NestingLevel is raised on the opening paren/square, and remains raised
What I don't understand is why you have to combine NestingLevel and IndentLevel at all. To me it feels wrong to add them no matter what (with and without your extra bit of logic).

IMO, for alignment, we should ensure that both NestingLevel *and* IndentLevel are the same, not just the the sum of the two is the same. That's why I was suggesting putting them into a pair and just comparing the pair. But I might be missing something very obvious.


More information about the cfe-commits mailing list