Skip to content

Commit

Permalink
PrintAboveWriter fix the last new line test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Apr 24, 2021
1 parent 7c697eb commit e9563d9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public PrintAboveWriter(LineReader reader) {
public void flush() {
StringBuffer buffer = getBuffer();
int lastNewline = buffer.lastIndexOf("\n");
if (lastNewline > 0) {
if (lastNewline >= 0) {
reader.printAbove(buffer.substring(0, lastNewline + 1));
buffer.delete(0, lastNewline + 1);
}
Expand Down

0 comments on commit e9563d9

Please sign in to comment.