[clang] [clang-format] Fix the indent of the ternary operator when AlignOperands and BreakBeforeTernaryOperators is specified. (PR #100860)
Hirofumi Nakamura via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 29 07:56:38 PDT 2024
hnakamura5 wrote:
> this is the default behavior of clang-format. And someone did intend it that way.
> If the change is desired, the BreakBeforeTernaryOperators option should be expanded to an enum or AlignOperands extended.
I agree. The current style has been default in this many years. Enough time to be got familiar with.
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#alignoperands
The issue https://github.com/llvm/llvm-project/issues/98559 can also be regarded as the inaccuracy of the manual. That says
> OAS_Align (in configuration: Align) Horizontally align operands of binary and ternary expressions
Only changing this part may be better.
If the precise alignment is desired, adding a new `AlignOperands` option is the way.
https://github.com/llvm/llvm-project/pull/100860
More information about the cfe-commits
mailing list