From b302f9a0fb8596c49899cbe5ad0c736b580a5753 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Fri, 8 Nov 2013 02:08:01 +0000 Subject: clang-format: Properly indent ObjC calls wrapped before first selector Before: [self // break a:a aa:aa aaaaa:aaa]; After: [self // break a:a aa:aa aaaaa:aaa]; llvm-svn: 194241 --- clang/lib/Format/ContinuationIndenter.cpp | 6 +++++- 1 file changed, 5 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 442f9fa8505..d075c7482d0 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -375,7 +375,11 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State, State.Line->StartsDefinition))) { State.Column = State.Stack.back().Indent; } else if (Current.Type == TT_ObjCSelectorName) { - if (State.Stack.back().ColonPos > Current.ColumnWidth) { + if (State.Stack.back().ColonPos == 0) { + State.Stack.back().ColonPos = + State.Stack.back().Indent + Current.LongestObjCSelectorName; + State.Column = State.Stack.back().ColonPos - Current.ColumnWidth; + } else if (State.Stack.back().ColonPos > Current.ColumnWidth) { State.Column = State.Stack.back().ColonPos - Current.ColumnWidth; } else { State.Column = State.Stack.back().Indent; -- cgit v1.2.3