summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-20 09:54:49 +0000
committerDaniel Jasper <djasper@google.com>2014-11-20 09:54:49 +0000
commit6cab6784b927cc55eea7eef560077a963fc5a404 (patch)
tree767b26ef7e596f0e6264ed8b234415895b7f089c /clang/lib/Format/ContinuationIndenter.cpp
parentcaf86859586eb87eeaa11355bc45369d088ff22b (diff)
downloadbcm5719-llvm-6cab6784b927cc55eea7eef560077a963fc5a404.tar.gz
bcm5719-llvm-6cab6784b927cc55eea7eef560077a963fc5a404.zip
clang-format: [Java] Don't align after "return".
Doesn't seem to be common practice in Java. Before: return aaaaaaaaaaaaaaaaaaa && bbbbbbbbbbbbbbbbbbb && ccccccccccccccccccc; After: return aaaaaaaaaaaaaaaaaaa && bbbbbbbbbbbbbbbbbbb && ccccccccccccccccccc; Patch by Harry Terkelsen. llvm-svn: 222424
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 24680ae76ca..40b50dde851 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -740,7 +740,8 @@ void ContinuationIndenter::moveStatePastFakeLParens(LineState &State,
// a builder type call after 'return' or, if the alignment after opening
// brackets is disabled.
if (!Current.isTrailingComment() &&
- (!Previous || Previous->isNot(tok::kw_return) || *I > 0) &&
+ (!Previous || Previous->isNot(tok::kw_return) ||
+ (Style.Language != FormatStyle::LK_Java && *I > 0)) &&
(Style.AlignAfterOpenBracket || *I != prec::Comma ||
Current.NestingLevel == 0))
NewParenState.Indent =
OpenPOWER on IntegriCloud