summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-06 13:13:03 +0000
committerDaniel Jasper <djasper@google.com>2015-05-06 13:13:03 +0000
commit2746a308c283a82e2d741b7ea9dde6e2d469ca3a (patch)
tree72fab8b28747a31228c709b60f9794afc08d58a0 /clang/lib/Format/ContinuationIndenter.cpp
parenteb53668c3501150ad99bd35df604dff3b5c9e079 (diff)
downloadbcm5719-llvm-2746a308c283a82e2d741b7ea9dde6e2d469ca3a.tar.gz
bcm5719-llvm-2746a308c283a82e2d741b7ea9dde6e2d469ca3a.zip
clang-format: Fix bad wrapping of ObjC method exprs.
Before: [aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa: aaaaaaaa aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]; After: [aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa:aaaaaaaa aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]; Note that this might now violate the column limit and we probably need an alternative way of indenting these then. However, that is still strictly better than the messy formatting that clang-format did before. llvm-svn: 236598
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 83f719bd1c9..430fe772392 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -166,6 +166,9 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
((Style.AllowShortFunctionsOnASingleLine != FormatStyle::SFS_All) ||
Style.BreakConstructorInitializersBeforeComma || Style.ColumnLimit != 0))
return true;
+ if (Current.is(TT_SelectorName) && State.Stack.back().ObjCSelectorNameFound &&
+ State.Stack.back().BreakBeforeParameter)
+ return true;
if (State.Column < getNewLineColumn(State))
return false;
@@ -203,9 +206,6 @@ bool ContinuationIndenter::mustBreak(const LineState &State) {
State.Stack.back().FirstLessLess == 0)
return true;
- if (Current.is(TT_SelectorName) && State.Stack.back().ObjCSelectorNameFound &&
- State.Stack.back().BreakBeforeParameter)
- return true;
if (Current.NestingLevel == 0 && !Current.isTrailingComment()) {
if (Previous.ClosesTemplateDeclaration)
return true;
OpenPOWER on IntegriCloud