dfmt
dfmt copied to clipboard
break in ternary operator that fits into a single line
./dfmt --keep_line_breaks=true test.d | diff -u100rN test.d -
class C
{
void f(
{
if (true)
{
if (true)
{
if (true)
{
return f(abcdefghijklmnopqrs.uv,
abcdefghijklmnopqrs.uvwxyz, abcdefghijklmnopqrs.uv, abcdefghijklmnopqrs.uvwxyzwx,
abcdefghijklmnopqrs.uvwxyz,
- abcdefghijklmnopqrs.uvwxyzabcde ? Yes.yes: No.yes,
+ abcdefghijklmnopqrs.uvwxyzabcde ? Yes.yes
+ : No.yes,
abcdefghijklmnopqrs.uvwxy ? Yes.nooo : No.nooo);
}
}
}
}
}
--- src/prognosis/control/Manager.d
+++ dfmt src/prognosis/control/Manager.d
@@ -199,5 +199,6 @@
VisitLink to = VisitLink(
- linkScheduled.linkType == LinkType.continuation ? CONTINUE_TRAINID_BEGIN : TURN_BEGIN,
- fetcher.get,
- feeder.get.journeyId.trainId
+ linkScheduled.linkType == LinkType.continuation ? CONTINUE_TRAINID_BEGIN
+ : TURN_BEGIN,
+ fetcher.get,
+ feeder.get.journeyId.trainId
);
⚠️ Note the strange indenting of the lines after the questionable ?: line break.
(dfmt: 0.14.2)