Typz added inline comments.

================
Comment at: clang/unittests/Format/FormatTest.cpp:6287
+  Style.BreakBeforeTernaryOperators = false;
+  verifyFormat("int x = aaaaaaaaaaaaaaa ? aaaaaaaaaaaaaaaaaa :\n"
+               "    bbbb                ? cccccccccccccccccc :\n"
----------------
sammccall wrote:
> aligning the question marks here is a bit weird (given DontAlign) but that's 
> another patch.
> 
> If we disable the question-column behavior with dontalign, this patch will be 
> completely dead, right?
> May want to add a FIXME to remove in that case.
I don't think this is so weird: even with DontAlign, there are other cases when 
some alignment is performed: for exemple when formatting tables in column.

As I see it, ternary operator formatting is a similar case of 2D formatting, 
and while it needs indeed to respect the "general" line wrapping/indent mode 
(as per AlignOperands), it is OK to keep the alignment of the ternary operator 
themselves : otherwise, the whole "mode" for ternary operators need to be 
disabled and makes no sense.

But anyway this is a different patch as you mentioned, and maybe some user of 
DontAlign can come up with a better approach for formatting ternary ops in that 
case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82199/new/

https://reviews.llvm.org/D82199



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to