Skip to content

Commit

Permalink
Regenerate line break hints after newline
Browse files Browse the repository at this point in the history
Fixes #486.
  • Loading branch information
belka-ew authored and dlang-bot committed Sep 3, 2020
1 parent 9435124 commit eab4cac
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dfmt/formatter.d
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ private:
{
pushWrapIndent();
newline();
if (ufcsWrap)
if (ufcsWrap || onNextLine)
regenLineBreakHints(index);
}
writeToken();
Expand Down
5 changes: 5 additions & 0 deletions tests/allman/issue0486.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void main()
{
auto someAutoVariableName = this.firstLink.secondLink
.filter!(shouldBeProbablySomeIdentifierOrNot);
}
1 change: 1 addition & 0 deletions tests/issue0486.args
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--keep_line_breaks=true
5 changes: 5 additions & 0 deletions tests/issue0486.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void main()
{
auto someAutoVariableName = this.firstLink.secondLink
.filter!(shouldBeProbablySomeIdentifierOrNot);
}
4 changes: 4 additions & 0 deletions tests/otbs/issue0486.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void main() {
auto someAutoVariableName = this.firstLink.secondLink
.filter!(shouldBeProbablySomeIdentifierOrNot);
}

0 comments on commit eab4cac

Please sign in to comment.