[PATCH] D35955: clang-format: Add preprocessor directive indentation

Erik Uhlmann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 2 12:23:16 PDT 2017


euhlmann added inline comments.


================
Comment at: lib/Format/ContinuationIndenter.cpp:383
+      Current.Previous->is(tok::hash) && State.FirstIndent > 0) {
+    // subtract 1 so indent lines up with non-preprocessor code
+    Spaces += State.FirstIndent;
----------------
djasper wrote:
> Same here and use full sentences.
> 
> Also, this does not seem to be what the example in the style option suggests and I'd rather not do it (subtracting 1).
I apologize, the style option documentation was a typo. The patch summary has the intended behavior, and I mentioned there that I count the hash as a column. Part of the reasoning for this is because it would look the same visually with spaces or tabs.


https://reviews.llvm.org/D35955





More information about the cfe-commits mailing list