From 0b7235c5f0188da5e84abfe4ccd2219cae4a1d7b Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 26 Aug 2025 07:17:51 +0000 Subject: [PATCH] Correctly calculate lines to clear for deletions, from Pavel Roskin. --- grid-view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grid-view.c b/grid-view.c index 4d687339..7590ea42 100644 --- a/grid-view.c +++ b/grid-view.c @@ -173,7 +173,7 @@ grid_view_delete_lines(struct grid *gd, u_int py, u_int ny, u_int bg) sy = grid_view_y(gd, gd->sy); grid_move_lines(gd, py, py + ny, sy - py - ny, bg); - grid_clear(gd, 0, sy - ny, gd->sx, py + ny - (sy - ny), bg); + grid_clear(gd, 0, sy - ny, gd->sx, ny, bg); } /* Delete lines inside scroll region. */ @@ -221,7 +221,7 @@ grid_view_delete_cells(struct grid *gd, u_int px, u_int py, u_int nx, u_int bg) sx = grid_view_x(gd, gd->sx); grid_move_cells(gd, px, px + nx, py, sx - px - nx, bg); - grid_clear(gd, sx - nx, py, px + nx - (sx - nx), 1, bg); + grid_clear(gd, sx - nx, py, nx, 1, bg); } /* Convert cells into a string. */