Skip to content

Commit 2686578

Browse files
committed
Fix #219
1 parent 98f443d commit 2686578

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

src/dfmt/formatter.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,8 @@ private:
563563
if (currentIs(tok!"("))
564564
{
565565
writeParens(false);
566+
if (tokens[index].type == tok!"{")
567+
return;
566568
if (index < tokens.length && tokens[index - 1].line < tokens[index].line)
567569
newline();
568570
else

tests/allman/issue0219.d.ref

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@OneOf("group1")
2+
{
3+
JSONValue[string] fred;
4+
bool mertz;
5+
bool ethel;
6+
}

tests/issue0219.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@OneOf("group1")
2+
{
3+
JSONValue[string] fred;
4+
bool mertz;
5+
bool ethel;
6+
}

tests/otbs/issue0219.d.ref

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@OneOf("group1") {
2+
JSONValue[string] fred;
3+
bool mertz;
4+
bool ethel;
5+
}

0 commit comments

Comments
 (0)