Fix #508
This commit is contained in:
parent
9dc690e23b
commit
c5d1dcad00
|
@ -11,7 +11,6 @@ import dparse.parser;
|
||||||
import dparse.rollback_allocator;
|
import dparse.rollback_allocator;
|
||||||
import dfmt.ast_info;
|
import dfmt.ast_info;
|
||||||
import dfmt.config;
|
import dfmt.config;
|
||||||
import dfmt.editorconfig : OptionalBoolean;
|
|
||||||
import dfmt.indentation;
|
import dfmt.indentation;
|
||||||
import dfmt.tokens;
|
import dfmt.tokens;
|
||||||
import dfmt.wrapping;
|
import dfmt.wrapping;
|
||||||
|
@ -480,7 +479,6 @@ private:
|
||||||
immutable j = justAddedExtraNewline;
|
immutable j = justAddedExtraNewline;
|
||||||
if (currIsSlashSlash)
|
if (currIsSlashSlash)
|
||||||
{
|
{
|
||||||
if (config.dfmt_keep_line_breaks != OptionalBoolean.t)
|
|
||||||
newline();
|
newline();
|
||||||
justAddedExtraNewline = j;
|
justAddedExtraNewline = j;
|
||||||
}
|
}
|
||||||
|
@ -588,6 +586,8 @@ private:
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
import dfmt.editorconfig : OptionalBoolean;
|
||||||
|
|
||||||
immutable p = current.type;
|
immutable p = current.type;
|
||||||
regenLineBreakHintsIfNecessary(index);
|
regenLineBreakHintsIfNecessary(index);
|
||||||
writeToken();
|
writeToken();
|
||||||
|
@ -765,6 +765,7 @@ private:
|
||||||
}
|
}
|
||||||
else if (hasCurrent && (currentIs(tok!"@")
|
else if (hasCurrent && (currentIs(tok!"@")
|
||||||
|| isBasicType(tokens[index].type)
|
|| isBasicType(tokens[index].type)
|
||||||
|
|| currentIs(tok!"invariant")
|
||||||
|| currentIs(tok!"extern")
|
|| currentIs(tok!"extern")
|
||||||
|| currentIs(tok!"identifier"))
|
|| currentIs(tok!"identifier"))
|
||||||
&& !currentIsIndentedTemplateConstraint())
|
&& !currentIsIndentedTemplateConstraint())
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
void foo()
|
|
||||||
{
|
|
||||||
afdsafds
|
|
||||||
.asdf // blah
|
|
||||||
.flub;
|
|
||||||
}
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
struct S
|
||||||
|
{
|
||||||
|
@safe invariant
|
||||||
|
{
|
||||||
|
assert(true);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
--keep_line_breaks=true
|
|
|
@ -1,6 +0,0 @@
|
||||||
void foo()
|
|
||||||
{
|
|
||||||
afdsafds
|
|
||||||
.asdf // blah
|
|
||||||
.flub;
|
|
||||||
}
|
|
|
@ -0,0 +1 @@
|
||||||
|
struct S {@safe invariant { assert(true); }}
|
|
@ -1,5 +0,0 @@
|
||||||
void foo() {
|
|
||||||
afdsafds
|
|
||||||
.asdf // blah
|
|
||||||
.flub;
|
|
||||||
}
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
struct S {
|
||||||
|
@safe invariant {
|
||||||
|
assert(true);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue