Hi,

Please see the attached patch file and test case for Bug 38525
<https://bugs.llvm.org/show_bug.cgi?id=38525> in Formatter.

Thanks,
Owen
Index: lib/Format/ContinuationIndenter.cpp
===================================================================
--- lib/Format/ContinuationIndenter.cpp	(revision 339102)
+++ lib/Format/ContinuationIndenter.cpp	(working copy)
@@ -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;
bool BreakBeforeBinaryOperators(bool someVeryVeryLongConditionThatBarelyFitsOnALine, bool someOtherLongishConditionPart1, bool someOtherEvenLongerNestedConditionPart2)
{
	return someVeryVeryLongConditionThatBarelyFitsOnALine && (someOtherLongishConditionPart1 || someOtherEvenLongerNestedConditionPart2);
}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to