mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 09:28:51 +00:00
Restore change in r1.17 but add checks to prevent the line length
overflowing, from Balazs Kezes.
This commit is contained in:
parent
d37f266524
commit
7cc4706646
@ -184,7 +184,9 @@ grid_view_insert_cells(struct grid *gd, u_int px, u_int py, u_int nx)
|
|||||||
px = grid_view_x(gd, px);
|
px = grid_view_x(gd, px);
|
||||||
py = grid_view_y(gd, py);
|
py = grid_view_y(gd, py);
|
||||||
|
|
||||||
sx = grid_view_x(gd, gd->sx);
|
sx = grid_view_x(gd, gd->linedata[py].cellsize);
|
||||||
|
if (sx < px + nx)
|
||||||
|
sx = px + nx;
|
||||||
|
|
||||||
if (px == sx - 1)
|
if (px == sx - 1)
|
||||||
grid_clear(gd, px, py, 1, 1);
|
grid_clear(gd, px, py, 1, 1);
|
||||||
@ -201,7 +203,9 @@ grid_view_delete_cells(struct grid *gd, u_int px, u_int py, u_int nx)
|
|||||||
px = grid_view_x(gd, px);
|
px = grid_view_x(gd, px);
|
||||||
py = grid_view_y(gd, py);
|
py = grid_view_y(gd, py);
|
||||||
|
|
||||||
sx = grid_view_x(gd, gd->sx);
|
sx = grid_view_x(gd, gd->linedata[py].cellsize);
|
||||||
|
if (sx < px + nx)
|
||||||
|
sx = px + nx;
|
||||||
|
|
||||||
grid_move_cells(gd, px, px + nx, py, sx - px - nx);
|
grid_move_cells(gd, px, px + nx, py, sx - px - nx);
|
||||||
grid_clear(gd, sx - nx, py, px + nx - (sx - nx), 1);
|
grid_clear(gd, sx - nx, py, px + nx - (sx - nx), 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user