summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authornicm <nicm>2017-11-15 19:21:24 +0000
committernicm <nicm>2017-11-15 19:21:24 +0000
commit533a5719c5edf53f0d7021d4340af230cc43ac8a (patch)
treeda123a233b70b2a4753fb5379fa0702efe218a42 /screen-write.c
parentaeda2e5808af7c4b629dce23d2b4331a77ecde83 (diff)
Completely rewrite the reflow code to correctly handle double width
characters (previously they were not accounted for).
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/screen-write.c b/screen-write.c
index 5ab472bd..1687e8c8 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -378,7 +378,8 @@ screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px,
gc.bg = mgc->bg;
}
}
- screen_write_cell(ctx, &gc);
+ if (xx + gc.data.width <= px + nx)
+ screen_write_cell(ctx, &gc);
}
cy++;
screen_write_cursormove(ctx, cx, cy);
@@ -410,6 +411,8 @@ screen_write_fast_copy(struct screen_write_ctx *ctx, struct screen *src,
if (xx >= gd->linedata[yy].cellsize)
break;
grid_get_cell(gd, xx, yy, &gc);
+ if (xx + gc.data.width > px + nx)
+ break;
if (!grid_cells_equal(&gc, &grid_default_cell))
grid_view_set_cell(ctx->s->grid, cx, cy, &gc);
cx++;