mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Fix #361 - Unexpected empty new line if function header ends with a comment
This commit is contained in:
parent
6d2a56e15e
commit
3af8edc57f
4 changed files with 42 additions and 1 deletions
|
@ -473,7 +473,7 @@ private:
|
|||
else if (!currentIs(tok!"{"))
|
||||
write(" ");
|
||||
}
|
||||
else if (!currentIs(tok!"{"))
|
||||
else if (!currentIs(tok!"{") && !currentIs(tok!"in") && !currentIs(tok!"out"))
|
||||
{
|
||||
if (currentIs(tok!")") && indents.topIs(tok!","))
|
||||
indents.pop();
|
||||
|
|
15
tests/allman/issue0361.d.ref
Normal file
15
tests/allman/issue0361.d.ref
Normal file
|
@ -0,0 +1,15 @@
|
|||
void foo() /**/
|
||||
in
|
||||
{
|
||||
}
|
||||
body
|
||||
{
|
||||
}
|
||||
|
||||
void bar() /**/
|
||||
out
|
||||
{
|
||||
}
|
||||
body
|
||||
{
|
||||
}
|
15
tests/issue0361.d
Normal file
15
tests/issue0361.d
Normal file
|
@ -0,0 +1,15 @@
|
|||
void foo() /**/
|
||||
in
|
||||
{
|
||||
}
|
||||
body
|
||||
{
|
||||
}
|
||||
|
||||
void bar() /**/
|
||||
out
|
||||
{
|
||||
}
|
||||
body
|
||||
{
|
||||
}
|
11
tests/otbs/issue0361.d.ref
Normal file
11
tests/otbs/issue0361.d.ref
Normal file
|
@ -0,0 +1,11 @@
|
|||
void foo() /**/
|
||||
in {
|
||||
}
|
||||
body {
|
||||
}
|
||||
|
||||
void bar() /**/
|
||||
out {
|
||||
}
|
||||
body {
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue