Skip to content

Commit

Permalink
Fix unwanted new line when using ERASE_LINE_ON_FINISH, fixes #181
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed May 17, 2018
1 parent 28e36be commit 557500c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -2250,20 +2250,22 @@ protected void cleanup() {
AttributedString oldPrompt = prompt;
buf.clear();
prompt = new AttributedString("");
doCleanup();
doCleanup(false);
prompt = oldPrompt;
buf.copyFrom(oldBuffer);
} else {
doCleanup();
doCleanup(true);
}
}

protected void doCleanup() {
protected void doCleanup(boolean nl) {
buf.cursor(buf.length());
post = null;
if (size.getColumns() > 0 || size.getRows() > 0) {
redisplay(false);
println();
if (nl) {
println();
}
terminal.puts(Capability.keypad_local);
terminal.trackMouse(Terminal.MouseTracking.Off);
if (isSet(Option.BRACKETED_PASTE))
Expand Down

0 comments on commit 557500c

Please sign in to comment.