From 46db867c41062b2415a41983d44769b11ce303ac Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Fri, 18 Sep 2015 10:46:20 -0700 Subject: [PATCH] Fix regression --- src/dfmt/formatter.d | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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!"=",