[PATCH] D50699: Extraneous continuation indent spaces with BreakBeforeBinaryOperators set to All

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 14 04:44:58 PDT 2018


owenpan created this revision.
owenpan added a project: clang.

See bug report https://bugs.llvm.org/show_bug.cgi?id=38525 for more details.


Repository:
  rC Clang

https://reviews.llvm.org/D50699

Files:
  lib/Format/ContinuationIndenter.cpp


Index: lib/Format/ContinuationIndenter.cpp
===================================================================
--- lib/Format/ContinuationIndenter.cpp
+++ lib/Format/ContinuationIndenter.cpp
@@ -700,7 +700,8 @@
     // Indent relative to the RHS of the expression unless this is a simple
     // assignment without binary expression on the RHS. Also indent relative to
     // unary operators and the colons of constructor initializers.
-    State.Stack.back().LastSpace = State.Column;
+    if (Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None)
+      State.Stack.back().LastSpace = State.Column;
   } else if (Previous.is(TT_InheritanceColon)) {
     State.Stack.back().Indent = State.Column;
     State.Stack.back().LastSpace = State.Column;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50699.160553.patch
Type: text/x-patch
Size: 754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180814/ac6816cc/attachment.bin>


More information about the cfe-commits mailing list