summaryrefslogtreecommitdiffstats
path: root/grid-view.c
diff options
context:
space:
mode:
authornicm <nicm>2014-11-08 12:58:31 +0000
committernicm <nicm>2014-11-08 12:58:31 +0000
commit8f1302282b02f07e0868fbcdb79bb5404010ad4e (patch)
treeb9e109907b7c1e5fbaeb05fea58d506350e91439 /grid-view.c
parentc6129f9c09ddc08d24640eeff1aa3082535f13c1 (diff)
Two improvements to reflow from Balazs Kezes:
- Don't extend the line to full width on insert/delete character which means leaves extra spaces when reflowing. - Only mark a line wrapped when the cursor actually goes off the end, not on newlines which can be used for positioning.
Diffstat (limited to 'grid-view.c')
-rw-r--r--grid-view.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/grid-view.c b/grid-view.c
index badabd56..f96a2d9e 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -184,7 +184,7 @@ 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);
+ sx = grid_view_x(gd, gd->linedata[py].cellsize);
if (px == sx - 1)
grid_clear(gd, px, py, 1, 1);
@@ -201,7 +201,7 @@ 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);
grid_move_cells(gd, px, px + nx, py, sx - px - nx);
grid_clear(gd, sx - nx, py, px + nx - (sx - nx), 1);