When multiple ternary operators are chained, e.g. like an if/else-if/
else-if/.../else sequence, clang-format will keep aligning the colon
with the question mark, which increases the indent for each
conditionals:
int a = condition1 ? result1 : condition2 ? result2 : condition3 ? result3 : result4;
This patch detects the situation (e.g. conditionals used in false branch
of another conditional), to avoid indenting in that case:
int a = condition1 ? result1 : condition2 ? result2 : condition3 ? result3 : result4;
When BreakBeforeTernaryOperators is false, this will format like this:
int a = condition1 ? result1 : condition2 ? result2 : conditino3 ? result3 : result4;
This formatting style is referenced here:
https://www.fluentcpp.com/2018/02/27/replace-else-if-ternary-operator/
and here:
https://marcmutz.wordpress.com/2010/10/14/top-5-reasons-you-should-love-your-ternary-operator/
Maybe it would be better to go through here whenever this is wrapped (e.g. Newline == true) : but this implies akso introducing a penalty for "breaking" the nested conditional alignment. May ultimately be better, though probably somewhat more complex still.