From f110e201e42742318199576d7009d5bc6a22f990 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Wed, 21 Aug 2013 08:39:01 +0000 Subject: clang-format: Indent relative to unary operators. Before: if (!aaaaaaaaaa( // break aaaaa)) { } After: if (!aaaaaaaaaa( // break aaaaa)) { } Also cleaned up formatting using clang-format. llvm-svn: 188891 --- clang/lib/Format/ContinuationIndenter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Format/ContinuationIndenter.cpp') diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index b26d453059f..65f465967f4 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -365,11 +365,13 @@ unsigned ContinuationIndenter::addTokenToState(LineState &State, bool Newline, State.Stack.back().LastSpace = State.Column; else if ((Previous.Type == TT_BinaryOperator || Previous.Type == TT_ConditionalExpr || + Previous.Type == TT_UnaryOperator || Previous.Type == TT_CtorInitializerColon) && !(Previous.getPrecedence() == prec::Assignment && Current.FakeLParens.empty())) // Always indent relative to the RHS of the expression unless this is a - // simple assignment without binary expression on the RHS. + // 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; else if (Previous.Type == TT_InheritanceColon) State.Stack.back().Indent = State.Column; -- cgit v1.2.3