From e4e309e5a4518779a1410e70763469b264eebed9 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 10 Mar 2019 18:31:46 +0000 Subject: [PATCH] clear_line(): replace size check with a resize. Turns out that my assertion that term->cols == line->cols can sometimes fail, because if the window is shrunk, scrlineptr() deliberately _doesn't_ shrink the line (so that the columns on the right can be recovered if the window is then resized larger again). So clear_line() should _make_ the line the right width, instead of asserting that it already is. --- terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index a6db4e8f..81aff9ee 100644 --- a/terminal.c +++ b/terminal.c @@ -2110,7 +2110,7 @@ static void check_selection(Terminal *term, pos from, pos to) static void clear_line(Terminal *term, termline *line) { - assert(term->cols == line->cols); + resizeline(term, line, term->cols); for (int i = 0; i < term->cols; i++) copy_termchar(line, i, &term->erase_char); line->lattr = LATTR_NORM;