diff --git a/src/dfmt.d b/src/dfmt.d index ae5f09f..76fbc92 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -383,7 +383,8 @@ private: case tok!"enum": indents.push(tok!"enum"); writeToken(); - write(" "); + if (!currentIs(tok!":")) + write(" "); break; default: if (index + 1 < tokens.length) diff --git a/tests/allman/issue0106.d.ref b/tests/allman/issue0106.d.ref new file mode 100644 index 0000000..00d28ef --- /dev/null +++ b/tests/allman/issue0106.d.ref @@ -0,0 +1,3 @@ +enum : int +{ +} diff --git a/tests/issue0106.d b/tests/issue0106.d new file mode 100644 index 0000000..33c2663 --- /dev/null +++ b/tests/issue0106.d @@ -0,0 +1,3 @@ +enum:int +{ +} diff --git a/tests/otbs/issue0106.d.ref b/tests/otbs/issue0106.d.ref new file mode 100644 index 0000000..9045b4f --- /dev/null +++ b/tests/otbs/issue0106.d.ref @@ -0,0 +1,2 @@ +enum : int { +}