aboutsummaryrefslogtreecommitdiff
path: root/grid-view.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2014-12-15 09:24:15 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2014-12-15 09:24:15 +0000
commitf495b150fa06cf0556159fe15e0dd2e0a09bb445 (patch)
tree7c48105f6febbe65b9cbed3027bffc1b8bc6e0d5 /grid-view.c
parent3771ab7c67ed002faa980b353bcc858669131b58 (diff)
parentccbe2545d9857e03731eddb9757989b9f52dc785 (diff)
downloadrtmux-f495b150fa06cf0556159fe15e0dd2e0a09bb445.tar.gz
rtmux-f495b150fa06cf0556159fe15e0dd2e0a09bb445.tar.bz2
rtmux-f495b150fa06cf0556159fe15e0dd2e0a09bb445.zip
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'grid-view.c')
-rw-r--r--grid-view.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/grid-view.c b/grid-view.c
index badabd56..078a0da4 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -184,7 +184,10 @@ grid_view_insert_cells(struct grid *gd, u_int px, u_int py, u_int nx)
px = grid_view_x(gd, px);
py = grid_view_y(gd, py);
- sx = grid_view_x(gd, gd->sx);
+ if (gd->linedata[py].cellsize + nx < gd->sx)
+ sx = grid_view_x(gd, gd->linedata[py].cellsize + nx);
+ else
+ sx = grid_view_x(gd, gd->sx);
if (px == sx - 1)
grid_clear(gd, px, py, 1, 1);
@@ -201,7 +204,9 @@ grid_view_delete_cells(struct grid *gd, u_int px, u_int py, u_int nx)
px = grid_view_x(gd, px);
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_clear(gd, sx - nx, py, px + nx - (sx - nx), 1);