From 87f18f1128ad86c6bfcf40c648419b6a02a943cb Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Fri, 6 Sep 2013 21:46:41 +0000 Subject: clang-format: Fix regression introduced by r190038. Before: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { } After: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { } llvm-svn: 190209 --- clang/lib/Format/ContinuationIndenter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'clang/lib/Format') diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 12cfd48f5b3..40d9d2f7d29 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -225,7 +225,12 @@ unsigned ContinuationIndenter::addTokenToState(LineState &State, bool Newline, Penalty += Style.PenaltyBreakFirstLessLess; if (Current.is(tok::r_brace)) { - State.Column = State.Stack[State.Stack.size() - 2].LastSpace; + if (Current.MatchingParen && + (Current.MatchingParen->BlockKind == BK_BracedInit || + !Current.MatchingParen->Children.empty())) + State.Column = State.Stack[State.Stack.size() - 2].LastSpace; + else + State.Column = State.FirstIndent; } else if (Current.is(tok::string_literal) && State.StartOfStringLiteral != 0) { State.Column = State.StartOfStringLiteral; -- cgit v1.2.3