diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index b0ab4f8..bbc42f1 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -1320,8 +1320,8 @@ private: } immutable l = indents.indentToMostRecent(tok!"switch"); if (l != -1) - indentLevel = config.dfmt_align_switch_statements - == OptionalBoolean.t ? l : indents.indentLevel; + indentLevel = config.dfmt_align_switch_statements == OptionalBoolean.t + ? l : indents.indentLevel; } else if (currentIs(tok!")")) { diff --git a/src/dfmt/indentation.d b/src/dfmt/indentation.d index a7b1005..7868db3 100644 --- a/src/dfmt/indentation.d +++ b/src/dfmt/indentation.d @@ -183,8 +183,8 @@ private: int parenCount; foreach (i; 0 .. j) { - immutable int pc = (arr[i] == tok!"!" || arr[i] == tok!"(" || arr[i] == tok!")") ? parenCount - + 1 : parenCount; + immutable int pc = (arr[i] == tok!"!" || arr[i] == tok!"(" || arr[i] == tok!")") ? parenCount + 1 + : parenCount; if ((isWrapIndent(arr[i]) || arr[i] == tok!"(") && parenCount > 1) { parenCount = pc; diff --git a/src/dfmt/tokens.d b/src/dfmt/tokens.d index 8c59c37..ec13172 100644 --- a/src/dfmt/tokens.d +++ b/src/dfmt/tokens.d @@ -133,12 +133,13 @@ int breakCost(IdType p, IdType c) pure nothrow @safe @nogc case tok!"||": case tok!"&&": case tok!",": + case tok!":": + case tok!"?": return 0; case tok!"(": return 60; case tok!"[": return 300; - case tok!":": case tok!";": case tok!"^^": case tok!"^=": @@ -169,7 +170,6 @@ int breakCost(IdType p, IdType c) pure nothrow @safe @nogc case tok!"!=": case tok!"!>=": case tok!"!>": - case tok!"?": case tok!"/=": case tok!"/": case tok!"..":