[PATCH] D93986: [clang-format] Add the possibility to align assignments spanning empty lines or comments

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 3 12:39:28 PST 2021


curdeius added inline comments.


================
Comment at: clang/lib/Format/WhitespaceManager.cpp:421
       // matching token, the sequence ends here.
-      if (Changes[i].NewlinesBefore > 1 || !FoundMatchOnLine)
+      if (((Changes[i].NewlinesBefore > 1) && (!AcrossEmpty)) ||
+          (!FoundMatchOnLine && (!(LineIsComment && AcrossComments))))
----------------
Nit: unnecessary parentheses around !AcrossEmpty.
Same around !(LineIsComment && AcrossComments).
Maybe you might factor out a bool variable for this condition?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93986



More information about the cfe-commits mailing list