When checking whether the region will scroll and the cursor position is thus

unsuitable for using CUD/CUU, check the current cursor position not the target
position.
pull/1/head
Nicholas Marriott 2009-10-16 19:09:40 +00:00
parent dba0d54cf5
commit 70355021d8
1 changed files with 2 additions and 2 deletions

4
tty.c
View File

@ -1057,14 +1057,14 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
*/ */
/* One above. */ /* One above. */
if (cy != tty->rupper && if (thisy != tty->rupper &&
cy == thisy - 1 && tty_term_has(term, TTYC_CUU1)) { cy == thisy - 1 && tty_term_has(term, TTYC_CUU1)) {
tty_putcode(tty, TTYC_CUU1); tty_putcode(tty, TTYC_CUU1);
goto out; goto out;
} }
/* One below. */ /* One below. */
if (cy != tty->rlower && if (thisy != tty->rlower &&
cy == thisy + 1 && tty_term_has(term, TTYC_CUD1)) { cy == thisy + 1 && tty_term_has(term, TTYC_CUD1)) {
tty_putcode(tty, TTYC_CUD1); tty_putcode(tty, TTYC_CUD1);
goto out; goto out;