summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-07-16 22:58:24 +0000
committerDaniel Jasper <djasper@google.com>2015-07-16 22:58:24 +0000
commit3c44c220f5adab7f21c61ba64094b949e4d4f03a (patch)
tree70f93e987733deef13924b0836e275c5eafb5d44 /clang/lib
parent1a7f648937933fd1bc7deb21705fe7c837da4c99 (diff)
downloadbcm5719-llvm-3c44c220f5adab7f21c61ba64094b949e4d4f03a.tar.gz
bcm5719-llvm-3c44c220f5adab7f21c61ba64094b949e4d4f03a.zip
clang-format: Respect IndentWrappedFunctionNames when aligning colons
Before: - (void)shortf:(GTMFoo *)theFoo dontAlignNamef:(NSRect)theRect { } After: - (void)shortf:(GTMFoo *)theFoo dontAlignNamef:(NSRect)theRect { } Patch by Kwasi Mensah, thank you! llvm-svn: 242484
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 9d73bf6c01e..83a5e1313a6 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -679,8 +679,13 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
if (Current.isMemberAccess())
State.Stack.back().StartOfFunctionCall =
Current.LastOperator ? 0 : State.Column;
- if (Current.is(TT_SelectorName))
+ if (Current.is(TT_SelectorName)) {
State.Stack.back().ObjCSelectorNameFound = true;
+ if (Style.IndentWrappedFunctionNames) {
+ State.Stack.back().Indent =
+ State.FirstIndent + Style.ContinuationIndentWidth;
+ }
+ }
if (Current.is(TT_CtorInitializerColon)) {
// Indent 2 from the column, so:
// SomeClass::SomeClass()
OpenPOWER on IntegriCloud