From 20f5e377fbe36bfee36f1a22777dafa77ff72ce5 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 7 Feb 2017 18:06:42 +0000 Subject: [PATCH 1/2] Remove a debugging leftover. --- format.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/format.c b/format.c index d8118513..145c31f5 100644 --- a/format.c +++ b/format.c @@ -859,9 +859,8 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen, *ptr = '\0'; found = format_find(ft, copy + 1, modifiers); - if (found == NULL) { - log_debug("XXX %s", copy + 1); - found = format_expand(ft, copy + 1);} + if (found == NULL) + found = format_expand(ft, copy + 1); if (format_choose(ptr + 1, &left, &right) != 0) goto fail; From c0a34821c14fd8ca7dd77782cb919028826ee4b9 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 7 Feb 2017 18:27:46 +0000 Subject: [PATCH 2/2] Do not clear the scroll region, instead set it to the scroll region we actually want. --- tty.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tty.c b/tty.c index 01e5fde2..e40e1081 100644 --- a/tty.c +++ b/tty.c @@ -1356,13 +1356,15 @@ tty_margin(struct tty *tty, u_int rleft, u_int rright) if (tty->rleft == rleft && tty->rright == rright) return; - tty->rupper = 0; - tty->rlower = tty->sy - 1; + tty_putcode2(tty, TTYC_CSR, tty->rupper, tty->rlower); tty->rleft = rleft; tty->rright = rright; - snprintf(s, sizeof s, "\033[r\033[%u;%us", rleft + 1, rright + 1); + if (rleft == 0 && rright == tty->sx - 1) + snprintf(s, sizeof s, "\033[s"); + else + snprintf(s, sizeof s, "\033[%u;%us", rleft + 1, rright + 1); tty_puts(tty, s); tty->cx = tty->cy = 0; }