mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 05:38:41 -09:00
term: fix edge case when clearing after a screen clear
This commit is contained in:
parent
d8e841a3d8
commit
e2215a3413
1 changed files with 6 additions and 6 deletions
12
app/term.js
12
app/term.js
|
|
@ -145,20 +145,20 @@ export default class Term extends Component {
|
||||||
const x = screen.cursorPosition.column;
|
const x = screen.cursorPosition.column;
|
||||||
const y = screen.cursorPosition.row;
|
const y = screen.cursorPosition.row;
|
||||||
|
|
||||||
if (y === 0) {
|
if (x === 0) {
|
||||||
// Empty screen, nothing to do.
|
// Empty screen, nothing to do.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < y; i++) {
|
|
||||||
screen.setCursorPosition(i, 0);
|
|
||||||
screen.clearCursorRow();
|
|
||||||
}
|
|
||||||
|
|
||||||
// here we move the row that the user was focused on
|
// here we move the row that the user was focused on
|
||||||
// to the top of the screen
|
// to the top of the screen
|
||||||
term.moveRows_(y, 1, 0);
|
term.moveRows_(y, 1, 0);
|
||||||
|
|
||||||
|
for (let i = 1; i < bottom; i++) {
|
||||||
|
screen.setCursorPosition(i, 0);
|
||||||
|
screen.clearCursorRow();
|
||||||
|
}
|
||||||
|
|
||||||
// we restore the cursor position
|
// we restore the cursor position
|
||||||
screen.setCursorPosition(0, x);
|
screen.setCursorPosition(0, x);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue