mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-28 22:29:56 +03:00
Fix #151
This commit is contained in:
parent
e16c7bd465
commit
56ea97efbb
4 changed files with 26 additions and 1 deletions
|
@ -261,7 +261,13 @@ private:
|
||||||
{
|
{
|
||||||
if (index < tokens.length && prevTokenEndLine == tokens[index].line)
|
if (index < tokens.length && prevTokenEndLine == tokens[index].line)
|
||||||
{
|
{
|
||||||
if (!currentIs(tok!"{"))
|
if (currentIs(tok!"}"))
|
||||||
|
{
|
||||||
|
if (indents.topIs(tok!"{"))
|
||||||
|
indents.pop();
|
||||||
|
write(" ");
|
||||||
|
}
|
||||||
|
else if (!currentIs(tok!"{"))
|
||||||
write(" ");
|
write(" ");
|
||||||
}
|
}
|
||||||
else if (!currentIs(tok!"{"))
|
else if (!currentIs(tok!"{"))
|
||||||
|
|
7
tests/allman/issue0151.d.ref
Normal file
7
tests/allman/issue0151.d.ref
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
void test()
|
||||||
|
{ /* ignore */ }
|
||||||
|
|
||||||
|
void test2()
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
}
|
7
tests/issue0151.d
Normal file
7
tests/issue0151.d
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
void test()
|
||||||
|
{ /* ignore */ }
|
||||||
|
|
||||||
|
void test2()
|
||||||
|
{
|
||||||
|
test();
|
||||||
|
}
|
5
tests/otbs/issue0151.d.ref
Normal file
5
tests/otbs/issue0151.d.ref
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
void test() { /* ignore */ }
|
||||||
|
|
||||||
|
void test2() {
|
||||||
|
test();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue