Correctly calculate lines to clear for deletions, from Pavel Roskin.

This commit is contained in:
nicm
2025-08-26 07:17:51 +00:00
parent ca0f0419e6
commit 0b7235c5f0

View File

@ -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. */