mirror of
https://github.com/dlang-community/dfmt.git
synced 2025-04-25 21:00:03 +03:00
Fix #224
This commit is contained in:
parent
268657831b
commit
e2d23726b9
4 changed files with 20 additions and 0 deletions
|
@ -364,6 +364,9 @@ private:
|
|||
immutable canAddNewline = currTokenLine - prevTokenEndLine < 1;
|
||||
if (peekBackIsOperator() && !isSeparationToken(t))
|
||||
pushWrapIndent(t);
|
||||
else if (peekBackIs(tok!",") && prevTokenEndLine == currTokenLine
|
||||
&& indents.indentToMostRecent(tok!"enum") == -1)
|
||||
pushWrapIndent(tok!",");
|
||||
if (peekBackIsOperator() && !peekBackIsOneOf(false, tok!"comment",
|
||||
tok!"{", tok!"}", tok!":", tok!";", tok!",", tok!"[", tok!"(")
|
||||
&& !canAddNewline && prevTokenEndLine < currTokenLine)
|
||||
|
|
6
tests/allman/issue0224.d.ref
Normal file
6
tests/allman/issue0224.d.ref
Normal file
|
@ -0,0 +1,6 @@
|
|||
unittest
|
||||
{
|
||||
int a, /// comment
|
||||
b, /// comment
|
||||
c; /// comment
|
||||
}
|
6
tests/issue0224.d
Normal file
6
tests/issue0224.d
Normal file
|
@ -0,0 +1,6 @@
|
|||
unittest
|
||||
{
|
||||
int a, /// comment
|
||||
b, /// comment
|
||||
c; /// comment
|
||||
}
|
5
tests/otbs/issue0224.d.ref
Normal file
5
tests/otbs/issue0224.d.ref
Normal file
|
@ -0,0 +1,5 @@
|
|||
unittest {
|
||||
int a, /// comment
|
||||
b, /// comment
|
||||
c; /// comment
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue