CUB and CUF are also limited by the margins so use CUP instead when

margins are enabled (we already do this for linefeed).
pull/1982/head
nicm 2019-11-14 07:56:32 +00:00
parent 08b07b1a08
commit eb399e64d5
1 changed files with 6 additions and 2 deletions

8
tty.c
View File

@ -2106,7 +2106,9 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
if ((u_int) abs(change) > cx && tty_term_has(term, TTYC_HPA)) {
tty_putcode1(tty, TTYC_HPA, cx);
goto out;
} else if (change > 0 && tty_term_has(term, TTYC_CUB)) {
} else if (change > 0 &&
tty_term_has(term, TTYC_CUB) &&
!tty_use_margin(tty)) {
if (change == 2 && tty_term_has(term, TTYC_CUB1)) {
tty_putcode(tty, TTYC_CUB1);
tty_putcode(tty, TTYC_CUB1);
@ -2114,7 +2116,9 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
}
tty_putcode1(tty, TTYC_CUB, change);
goto out;
} else if (change < 0 && tty_term_has(term, TTYC_CUF)) {
} else if (change < 0 &&
tty_term_has(term, TTYC_CUF) &&
!tty_use_margin(tty)) {
tty_putcode1(tty, TTYC_CUF, -change);
goto out;
}