-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
6.8.0
-
None
Support formatting ternary operators on separate lines like this:
a: b ? c : d
This can be done by modifying the visit method:
qqmldomreformatter.cpp
bool ScriptFormatter::visit(ConditionalExpression *ast)
{
accept(ast->expression);
++expressionDepth;
const int baseIndent = lw.increaseIndent(1);
newLine();
out("? "); // ast->questionToken
accept(ast->ok);
newLine();
out(": "); // ast->colonToken
accept(ast->ko);
lw.decreaseIndent(1, baseIndent);
--expressionDepth;
return false;
}
| For Gerrit Dashboard: QTBUG-132055 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 625737,12 | qmlformat: Ternary operators on separate lines | dev | qt/qtdeclarative | Status: NEW | -1 | +1 |
| 630406,1 | WIP: qmlformat: Ternary operators on separate lines | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |