summaryrefslogtreecommitdiffstats
path: root/grid-view.c
diff options
context:
space:
mode:
authornicm <nicm>2014-12-01 22:22:14 +0000
committernicm <nicm>2014-12-01 22:22:14 +0000
commite52d7912122177ddff952feccc192a3f357b9d1b (patch)
treee5d1f0f42a1a6fc5e142e98ffec0124283616b4e /grid-view.c
parentc8bf8ee931e4ccfe709f5ac36fb210e938eeec50 (diff)
Another fix for insertion from Balazs Kezes. On insertion, size the line
just enough for the inserted characters.
Diffstat (limited to 'grid-view.c')
-rw-r--r--grid-view.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/grid-view.c b/grid-view.c
index a34c5a08..078a0da4 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -184,9 +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->linedata[py].cellsize);
- if (sx < px + nx)
- sx = px + nx;
+ 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);