Skip to content

Commit

Permalink
Fix pushlineuntil having extra lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mclaughlinconnor committed Sep 6, 2024
1 parent 0169479 commit 2d31483
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util/PushLineUntil.hx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package util;

function pushLinesUntil(formattedString:StringBuf, lines:Array<String>, start:Int, end:Int, trailingNewline:Bool = true) {
if (start == end) {
return start;
}

while (start < end - 1) {
formattedString.add(lines[start++]);
formattedString.add("\n");
}

formattedString.add(lines[start]);
formattedString.add(lines[start++]);
if (trailingNewline) {
formattedString.add("\n");
}
Expand Down

0 comments on commit 2d31483

Please sign in to comment.