diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 3315aa8..36de9c9 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -380,6 +380,8 @@ private: { break; } + else if (currentIs(tok!"{") && config.dfmt_brace_style == BraceStyle.allman) + break; else if (t == tok!"import" && !currentIs(tok!"import") && !currentIs(tok!"}") && !(currentIs(tok!"public") && peekIs(tok!"import"))) diff --git a/tests/allman/issue0206.d.ref b/tests/allman/issue0206.d.ref new file mode 100644 index 0000000..b30fc9b --- /dev/null +++ b/tests/allman/issue0206.d.ref @@ -0,0 +1,8 @@ +unittest +{ + import std.stdio : stderr; + + { + a = 10; + } +} diff --git a/tests/issue0206.d b/tests/issue0206.d new file mode 100644 index 0000000..91965e1 --- /dev/null +++ b/tests/issue0206.d @@ -0,0 +1,8 @@ +unittest +{ + import std.stdio : stderr; + + { + a = 10; + } +} diff --git a/tests/otbs/issue0206.d.ref b/tests/otbs/issue0206.d.ref new file mode 100644 index 0000000..b0ec36a --- /dev/null +++ b/tests/otbs/issue0206.d.ref @@ -0,0 +1,7 @@ +unittest { + import std.stdio : stderr; + + { + a = 10; + } +}