diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index e9b0d20..eff1a53 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -563,6 +563,8 @@ private: if (currentIs(tok!"(")) { writeParens(false); + if (tokens[index].type == tok!"{") + return; if (index < tokens.length && tokens[index - 1].line < tokens[index].line) newline(); else diff --git a/tests/allman/issue0219.d.ref b/tests/allman/issue0219.d.ref new file mode 100644 index 0000000..e781463 --- /dev/null +++ b/tests/allman/issue0219.d.ref @@ -0,0 +1,6 @@ +@OneOf("group1") +{ + JSONValue[string] fred; + bool mertz; + bool ethel; +} diff --git a/tests/issue0219.d b/tests/issue0219.d new file mode 100644 index 0000000..dcc6c5f --- /dev/null +++ b/tests/issue0219.d @@ -0,0 +1,6 @@ +@OneOf("group1") +{ + JSONValue[string] fred; + bool mertz; + bool ethel; +} diff --git a/tests/otbs/issue0219.d.ref b/tests/otbs/issue0219.d.ref new file mode 100644 index 0000000..cfab244 --- /dev/null +++ b/tests/otbs/issue0219.d.ref @@ -0,0 +1,5 @@ +@OneOf("group1") { + JSONValue[string] fred; + bool mertz; + bool ethel; +}