summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-03-17 14:32:47 +0000
committerDaniel Jasper <djasper@google.com>2014-03-17 14:32:47 +0000
commit1fd6f1f8d6ce5dda212260c90a357f93087de536 (patch)
treebaeee883f002d7093fbb8619acab00d68318156f /clang/lib/Format/ContinuationIndenter.cpp
parentc7e4e219b500d84eb5032afb0d0fde5db335d1e8 (diff)
downloadbcm5719-llvm-1fd6f1f8d6ce5dda212260c90a357f93087de536.tar.gz
bcm5719-llvm-1fd6f1f8d6ce5dda212260c90a357f93087de536.zip
clang-format: Indent from dict literal labels.
Before: @{ NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee : regularFont, }; After: @{ NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee : regularFont, }; llvm-svn: 204041
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