diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 57aae77..c0e5f7a 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -789,14 +789,11 @@ private: else if (!peekBackIsOneOf(false, tok!"(", tok!",", tok!"!")) write(" "); writeToken(); - if (!isContract) - { - if (config.dfmt_brace_style == BraceStyle.allman) - newline(); - else - write(" "); - } - + immutable isFunctionLit = astInformation.funLitStartLocations.canFindIndex(current.index); + if (isFunctionLit && config.dfmt_brace_style == BraceStyle.allman) + newline(); + else if (!isContract) + write(" "); break; case tok!"is": if (!peekBackIsOneOf(false, tok!"!", tok!"(", tok!",", tok!"}", tok!"=",