Skip to content

Commit

Permalink
Split the methods to give a bit more freedom
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Sep 29, 2023
1 parent 48ac368 commit 442c055
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions src/main/java/org/fusesource/jansi/Ansi.java
Original file line number Diff line number Diff line change
Expand Up @@ -716,24 +716,40 @@ public Ansi scrollDown(final int rows) {
return rows > 0 ? appendEscapeSequence('T', rows) : rows < 0 ? scrollUp(-rows) : this;
}

@Deprecated
public Ansi restorCursorPosition() {
return restoreCursorPosition();
}

public Ansi saveCursorPosition() {
// SCO command
appendEscapeSequence('s');
// DEC command
saveCursorPositionSCO();
return saveCursorPositionDEC();
}

// SCO command
public Ansi saveCursorPositionSCO() {
return appendEscapeSequence('s');
}

// DEC command
public Ansi saveCursorPositionDEC() {
builder.append(FIRST_ESC_CHAR);
builder.append('7');
return this;
}

@Deprecated
public Ansi restorCursorPosition() {
return restoreCursorPosition();
public Ansi restoreCursorPosition() {
restoreCursorPositionSCO();
return restoreCursorPositionDEC();
}

public Ansi restoreCursorPosition() {
// SCO command
appendEscapeSequence('u');
// DEC command
// SCO command
public Ansi restoreCursorPositionSCO() {
return appendEscapeSequence('u');
}

// DEC command
public Ansi restoreCursorPositionDEC() {
builder.append(FIRST_ESC_CHAR);
builder.append('8');
return this;
Expand Down

0 comments on commit 442c055

Please sign in to comment.