summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 17af2fa5f25..380532a47cc 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -426,8 +426,9 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State,
} else if (NextNonComment->Type == TT_StartOfName ||
Previous.isOneOf(tok::coloncolon, tok::equal)) {
State.Column = ContinuationIndent;
- } else if (PreviousNonComment &&
- PreviousNonComment->Type == TT_ObjCMethodExpr) {
+ } else if (PreviousNonComment && PreviousNonComment->is(tok::colon) &&
+ (PreviousNonComment->Type == TT_ObjCMethodExpr ||
+ PreviousNonComment->Type == TT_DictLiteral)) {
State.Column = ContinuationIndent;
// FIXME: This is hacky, find a better way. The problem is that in an ObjC
// method expression, the block should be aligned to the line starting it,
OpenPOWER on IntegriCloud