Fix #490
This commit is contained in:
parent
f80bffcf84
commit
69bd684b44
|
@ -9,8 +9,9 @@ module dfmt.formatter;
|
||||||
import dparse.lexer;
|
import dparse.lexer;
|
||||||
import dparse.parser;
|
import dparse.parser;
|
||||||
import dparse.rollback_allocator;
|
import dparse.rollback_allocator;
|
||||||
import dfmt.config;
|
|
||||||
import dfmt.ast_info;
|
import dfmt.ast_info;
|
||||||
|
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;
|
||||||
|
@ -477,7 +478,8 @@ private:
|
||||||
immutable j = justAddedExtraNewline;
|
immutable j = justAddedExtraNewline;
|
||||||
if (currIsSlashSlash)
|
if (currIsSlashSlash)
|
||||||
{
|
{
|
||||||
newline();
|
if (config.dfmt_keep_line_breaks != OptionalBoolean.t)
|
||||||
|
newline();
|
||||||
justAddedExtraNewline = j;
|
justAddedExtraNewline = j;
|
||||||
}
|
}
|
||||||
else if (hasCurrent)
|
else if (hasCurrent)
|
||||||
|
@ -584,8 +586,6 @@ private:
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
import dfmt.editorconfig : OptionalBoolean;
|
|
||||||
|
|
||||||
immutable p = current.type;
|
immutable p = current.type;
|
||||||
regenLineBreakHintsIfNecessary(index);
|
regenLineBreakHintsIfNecessary(index);
|
||||||
writeToken();
|
writeToken();
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
void foo()
|
||||||
|
{
|
||||||
|
afdsafds
|
||||||
|
.asdf // blah
|
||||||
|
.flub;
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
--keep_line_breaks=true
|
|
@ -0,0 +1,6 @@
|
||||||
|
void foo()
|
||||||
|
{
|
||||||
|
afdsafds
|
||||||
|
.asdf // blah
|
||||||
|
.flub;
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
void foo() {
|
||||||
|
afdsafds
|
||||||
|
.asdf // blah
|
||||||
|
.flub;
|
||||||
|
}
|
Loading…
Reference in New Issue