mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Format do like body after function attributes
This commit is contained in:
parent
821b9be9e9
commit
995c21ab87
4 changed files with 15 additions and 4 deletions
|
@ -274,6 +274,10 @@ private:
|
|||
else
|
||||
formatBlockHeader();
|
||||
}
|
||||
else if ((current.text == "body" || current == tok!"do") && peekBackIsFunctionDeclarationEnding())
|
||||
{
|
||||
formatKeyword();
|
||||
}
|
||||
else if (currentIs(tok!"do"))
|
||||
{
|
||||
formatBlockHeader();
|
||||
|
@ -321,10 +325,6 @@ private:
|
|||
inlineElse = true;
|
||||
formatKeyword();
|
||||
}
|
||||
else if (current.text == "body" && peekBackIsFunctionDeclarationEnding())
|
||||
{
|
||||
formatKeyword();
|
||||
}
|
||||
else if (isBasicType(current.type))
|
||||
{
|
||||
writeToken();
|
||||
|
|
4
tests/allman/issue0528.d.ref
Normal file
4
tests/allman/issue0528.d.ref
Normal file
|
@ -0,0 +1,4 @@
|
|||
void f() return
|
||||
do
|
||||
{
|
||||
}
|
4
tests/issue0528.d
Normal file
4
tests/issue0528.d
Normal file
|
@ -0,0 +1,4 @@
|
|||
void f() return
|
||||
do
|
||||
{
|
||||
}
|
3
tests/otbs/issue0528.d.ref
Normal file
3
tests/otbs/issue0528.d.ref
Normal file
|
@ -0,0 +1,3 @@
|
|||
void f() return
|
||||
do {
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue