diff --git a/src/dfmt.d b/src/dfmt.d index f9c375e..9d34cf7 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -480,11 +480,25 @@ private: else writeToken(); break; + case tok!"@": + writeToken(); + if (currentIs(tok!"identifier")) + writeToken(); + if (currentIs(tok!"(")) + { + writeParens(false); + if (index < tokens.length && tokens[index - 1].line < tokens[index].line) + newline(); + else + write(" "); + } + else if (index < tokens.length && !isOperator(tokens[index].type)) + write(" "); + break; case tok!"!": if (peekIs(tok!"is")) write(" "); - goto case ; - case tok!"@": + goto case; case tok!"...": case tok!"[": case tok!"++": diff --git a/tests/allman/issue0048.d.ref b/tests/allman/issue0048.d.ref new file mode 100644 index 0000000..d960f6e --- /dev/null +++ b/tests/allman/issue0048.d.ref @@ -0,0 +1,5 @@ +@Shortcut("[shift] + [tab]") +@MenuItem("Text/Decrease") +void textDecreaseIndent(BufferView v) +{ +} diff --git a/tests/issue0048.d b/tests/issue0048.d new file mode 100644 index 0000000..d960f6e --- /dev/null +++ b/tests/issue0048.d @@ -0,0 +1,5 @@ +@Shortcut("[shift] + [tab]") +@MenuItem("Text/Decrease") +void textDecreaseIndent(BufferView v) +{ +} diff --git a/tests/otbs/issue0048.d.ref b/tests/otbs/issue0048.d.ref new file mode 100644 index 0000000..0d206fd --- /dev/null +++ b/tests/otbs/issue0048.d.ref @@ -0,0 +1,4 @@ +@Shortcut("[shift] + [tab]") +@MenuItem("Text/Decrease") +void textDecreaseIndent(BufferView v) { +}