[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

Jacob Bandes-Storch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 1 23:49:33 PDT 2017


jtbandes added inline comments.


================
Comment at: lib/Format/WhitespaceManager.cpp:523
+      if (C.NewlinesBefore > 0 && C.ContinuesPPDirective)
+        C.EscapedNewlineColumn = C.PreviousEndOfTokenColumn + 2;
+    return;
----------------
djasper wrote:
> I think we should not duplicate this loop. Two alternatives:
> 1. Move this into the other loop. As long as you reset StartOfMacro in each iteration, it should do the right thing.
> 2. Make this work if we just return here. In theory, the "\" should not need any special-casing with this style.
> 
> I'd prefer #2.
I first tried returning here, but the backslashes were butting up against the content, as in `int x = foo;\`. I can look around to see if that's fixable.


https://reviews.llvm.org/D32733





More information about the cfe-commits mailing list