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-05-15 16:40:31 +0200
commit0ee04e6e0d0e1c808dc6c70ff7b92b35f960b627 (patch)
treeb2962122bba912611be937586f6666936e2fa39e /clang/unittests/Format/FormatTestJS.cpp
parent4db94094b469b4715d08ef37f1799bf3ea7ca8ea (diff)
downloadllvm-0ee04e6e0d0e1c808dc6c70ff7b92b35f960b627.zip
llvm-0ee04e6e0d0e1c808dc6c70ff7b92b35f960b627.tar.gz
llvm-0ee04e6e0d0e1c808dc6c70ff7b92b35f960b627.tar.bz2
[clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set
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, the operands are actually aligned, and the operator gets aligned with the equal sign: int aaaaa = bbbbbb + cccccc; This not happen in tests, to avoid 'breaking' the indentation: if (aaaaa && bbbbb) return; Reviewers: krasimir, djasper, klimek, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: MyDeveloperDay, acoomans, cfe-commits, klimek Tags: #clang, #clang-format 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 07e25e8..da26a9b 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -275,7 +275,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);