This commit is contained in:
Hackerpilot 2015-08-24 13:27:22 -07:00
parent 46669f8073
commit 43cfa09e7e
4 changed files with 85 additions and 3 deletions

View File

@ -284,10 +284,8 @@ private:
immutable canAddNewline = currTokenLine - prevTokenEndLine < 1;
if (prevTokenEndLine == currTokenLine || (t == tok!")" && peekIs(tok!"{")))
write(" ");
else if (t != tok!";" && t != tok!"}" && canAddNewline)
{
else if (canAddNewline || (peekIs(tok!"{") && t == tok!"}"))
newline();
}
}
writeToken();
immutable j = justAddedExtraNewline;

View File

@ -0,0 +1,29 @@
unittest
{
{
}
//
{
}
}
unittest
{
{
}
//
{
}
}
unittest
{
{
}
//
{
}
}

29
tests/issue0177.d Normal file
View File

@ -0,0 +1,29 @@
unittest
{
{
}
//
{
}
}
unittest
{
{
}
//
{
}
}
unittest
{
{
}
//
{
}
}

View File

@ -0,0 +1,26 @@
unittest {
{
}
//
{
}
}
unittest {
{
}
//
{
}
}
unittest {
{
}
//
{
}
}