summaryrefslogtreecommitdiffstats
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2019-11-14 07:56:32 +0000
committernicm <nicm>2019-11-14 07:56:32 +0000
commiteb399e64d5c8f1b18e912fdf1c5488d602f78d80 (patch)
tree747c765584b40d98b8c7fab94cd5ab2173136468 /tty.c
parent08b07b1a08ad02f7a195437deead0a60f971e1ee (diff)
CUB and CUF are also limited by the margins so use CUP instead when
margins are enabled (we already do this for linefeed).
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tty.c b/tty.c
index f8abb17a..d77bb440 100644
--- a/tty.c
+++ b/tty.c
@@ -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;
}