From db8804b32b17593e808173abe52f747a8d78ad8d Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 14 Apr 2014 12:11:07 +0000 Subject: clang-format: Improve array literal formatting fix in r206161. Instead of choosing based on the number of elements, simply respect the user's choice of where to wrap array literals. llvm-svn: 206162 --- clang/lib/Format/ContinuationIndenter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Format') diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 43997f99576..0ad8c1eb419 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -142,7 +142,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { return true; if (((Previous.Type == TT_DictLiteral && Previous.is(tok::l_brace)) || Previous.Type == TT_ArrayInitializerLSquare) && - (Style.ColumnLimit > 0 || Previous.ParameterCount > 1) && + Style.ColumnLimit > 0 && getLengthToMatchingParen(Previous) + State.Column > getColumnLimit(State)) return true; if (Current.Type == TT_CtorInitializerColon && -- cgit v1.2.3