From d58c3793d6ccd618e13287974e8145f640a3185a Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 13 May 2017 07:30:50 +0000 Subject: [PATCH 1/2] Some other unused variables. --- grid.c | 3 +-- tty.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/grid.c b/grid.c index 3b03df75..f76980fb 100644 --- a/grid.c +++ b/grid.c @@ -286,7 +286,7 @@ grid_clear_history(struct grid *gd) void grid_scroll_history_region(struct grid *gd, u_int upper, u_int lower, u_int bg) { - struct grid_line *gl_history, *gl_upper, *gl_lower; + struct grid_line *gl_history, *gl_upper; u_int yy; /* Create a space for a new line. */ @@ -302,7 +302,6 @@ grid_scroll_history_region(struct grid *gd, u_int upper, u_int lower, u_int bg) upper++; gl_upper = &gd->linedata[upper]; lower++; - gl_lower = &gd->linedata[lower]; /* Move the line into the history. */ memcpy(gl_history, gl_upper, sizeof *gl_history); diff --git a/tty.c b/tty.c index d638f7d0..8bad7325 100644 --- a/tty.c +++ b/tty.c @@ -1145,11 +1145,10 @@ void tty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx) { struct window_pane *wp = ctx->wp; - u_int nx, py = ctx->yoff + ctx->ocy; + u_int py = ctx->yoff + ctx->ocy; tty_default_attributes(tty, wp, ctx->bg); - nx = screen_size_x(wp->screen) - ctx->ocx; tty_clear_line(tty, wp, py, ctx->xoff, ctx->ocx + 1, ctx->bg); } From 7a4c66b7f5710e92f4af2bdfdb3b88bd64306320 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 13 May 2017 07:41:59 +0000 Subject: [PATCH 2/2] Scroll the right number of lines off the region when clearing. --- tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tty.c b/tty.c index 8bad7325..84df06cb 100644 --- a/tty.c +++ b/tty.c @@ -838,7 +838,7 @@ tty_clear_area(struct tty *tty, const struct window_pane *wp, u_int py, tty_term_has(tty->term, TTYC_INDN)) { tty_region(tty, py, py + ny - 1); tty_margin_off(tty); - tty_putcode1(tty, TTYC_INDN, ny); + tty_putcode1(tty, TTYC_INDN, ny - 1); return; } @@ -853,7 +853,7 @@ tty_clear_area(struct tty *tty, const struct window_pane *wp, u_int py, tty_term_has(tty->term, TTYC_INDN)) { tty_region(tty, py, py + ny - 1); tty_margin(tty, px, px + nx - 1); - tty_putcode1(tty, TTYC_INDN, ny); + tty_putcode1(tty, TTYC_INDN, ny - 1); return; } }