[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
Showing
- clang/docs/ClangFormatStyleOptions.rst 38 additions, 6 deletionsclang/docs/ClangFormatStyleOptions.rst
- clang/include/clang/Format/Format.h 35 additions, 8 deletionsclang/include/clang/Format/Format.h
- clang/lib/Format/ContinuationIndenter.cpp 31 additions, 4 deletionsclang/lib/Format/ContinuationIndenter.cpp
- clang/lib/Format/ContinuationIndenter.h 8 additions, 1 deletionclang/lib/Format/ContinuationIndenter.h
- clang/lib/Format/Format.cpp 17 additions, 4 deletionsclang/lib/Format/Format.cpp
- clang/unittests/Format/FormatTest.cpp 123 additions, 8 deletionsclang/unittests/Format/FormatTest.cpp
- clang/unittests/Format/FormatTestJS.cpp 1 addition, 1 deletionclang/unittests/Format/FormatTestJS.cpp
Loading
Please register or sign in to comment