diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 608c384..8c01e34 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -474,6 +474,8 @@ private: { writeToken(); linebreakHints = []; + while (indents.topIs(tok!"enum")) + indents.pop(); newline(); } } diff --git a/tests/allman/issue0127.d.ref b/tests/allman/issue0127.d.ref new file mode 100644 index 0000000..a6b95af --- /dev/null +++ b/tests/allman/issue0127.d.ref @@ -0,0 +1,4 @@ +version (Windows) + enum root = `C:\`; +else + enum root = "/"; diff --git a/tests/issue0127.d b/tests/issue0127.d new file mode 100644 index 0000000..6265a81 --- /dev/null +++ b/tests/issue0127.d @@ -0,0 +1,4 @@ +version (Windows) + enum root = `C:\`; +else + enum root = "/"; diff --git a/tests/otbs/issue0127.d.ref b/tests/otbs/issue0127.d.ref new file mode 100644 index 0000000..a6b95af --- /dev/null +++ b/tests/otbs/issue0127.d.ref @@ -0,0 +1,4 @@ +version (Windows) + enum root = `C:\`; +else + enum root = "/"; diff --git a/tests/test b/tests/test index 5c66bf9..7f11c5a 100755 --- a/tests/test +++ b/tests/test @@ -6,9 +6,11 @@ do for source in *.d do echo "${source}.ref" "${braceStyle}/${source}.out" - argsFile=$(basename ${source}).args + argsFile=$(basename ${source} .d).args if [ -e ${argsFile} ]; then args=$(cat ${argsFile}) + else + args= fi ../bin/dfmt --brace_style=${braceStyle} ${args} "${source}" > "${braceStyle}/${source}.out" diff -u "${braceStyle}/${source}.ref" "${braceStyle}/${source}.out"