From 70743fddf4bd390e684f56d2c974e0b9c3507a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 3 Jul 2019 14:15:23 +0200 Subject: [PATCH] scrolling: hopefully fix bad damage update of items outside scrolling region --- terminal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terminal.c b/terminal.c index d7eeba15..df74e9db 100644 --- a/terminal.c +++ b/terminal.c @@ -240,8 +240,8 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows int start = it->item.range.start - term->grid->offset; int end __attribute__((unused)) = start + it->item.range.length; - if (start < region.start) { - assert(end <= region.start); + if (start < region.start * term->cols) { + assert(end <= region.start * term->cols); it->item.range.start += rows * term->cols; } } @@ -259,8 +259,8 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows int start = it->item.range.start - term->grid->offset; int end = start + it->item.range.length; - if (end > region.end) { - assert(start >= region.end); + if (end > region.end * term->cols) { + assert(start >= region.end * term->cols); it->item.range.start += rows * term->cols; } }