aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestJS.cpp
diff options
context:
space:
mode:
authorFrancois Ferrand <thetypz@gmail.com>2017-05-22 11:23:08 +0200
committerFrancois Ferrand <francois.ferrand@faurecia.com>2020-04-22 17:36:38 +0200
commit3d61b1120e8267aa39f4c9a33d618dbaec4ec6fa (patch)
tree29276258cf21b36612fe4984e733c498d2f23c1b /clang/unittests/Format/FormatTestJS.cpp
parent5daa25fd7a184524759b6ad065a8bd7e95aa149a (diff)
downloadllvm-3d61b1120e8267aa39f4c9a33d618dbaec4ec6fa.zip
llvm-3d61b1120e8267aa39f4c9a33d618dbaec4ec6fa.tar.gz
llvm-3d61b1120e8267aa39f4c9a33d618dbaec4ec6fa.tar.bz2
clang-format: Introduce stricter AlignOperands flag
Summary: Even when BreakBeforeBinaryOperators is set, AlignOperands kept aligning the beginning of the line, even when it could align the actual operands (e.g. after an assignment). With this patch, there is an option to actually align the operands, so that the operator gets right-aligned with the equal sign or return operator: int aaaaa = bbbbbb + cccccc; return aaaaaaa && bbbbbbb; This not happen in parentheses, to avoid 'breaking' the indentation: if (aaaaa && bbbbb) return; Reviewers: krasimir, djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D32478
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index eadea35..c1c4706 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -277,7 +277,7 @@ TEST_F(FormatTestJS, UnderstandsJavaScriptOperators) {
verifyFormat("var x = aaaaaaaaaaaaaaaaaaaaaaaaa() in\n"
" aaaa.aaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;");
FormatStyle Style = getGoogleJSStyleWithColumns(80);
- Style.AlignOperands = true;
+ Style.AlignOperands = FormatStyle::OAS_Align;
verifyFormat("var x = aaaaaaaaaaaaaaaaaaaaaaaaa() in\n"
" aaaa.aaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;",
Style);