aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
diff options
context:
space:
mode:
authornicm <nicm>2017-03-06 09:02:36 +0000
committernicm <nicm>2017-03-06 09:02:36 +0000
commitfba9ebcc0c6c8e28150f484b9d1f1cb1f588eb9c (patch)
treeba7a48cc42bcb4447dff9cd906f00240248eeb5f /screen-write.c
parente741a0bcd7775fab1db822ea6707cd32b0ea9799 (diff)
downloadrtmux-fba9ebcc0c6c8e28150f484b9d1f1cb1f588eb9c.tar.gz
rtmux-fba9ebcc0c6c8e28150f484b9d1f1cb1f588eb9c.tar.bz2
rtmux-fba9ebcc0c6c8e28150f484b9d1f1cb1f588eb9c.zip
When redrawing a combined UTF-8 characters in its existing position,
need to save and restore the cursor so that the next character goes into the right place.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/screen-write.c b/screen-write.c
index 937870f9..d9d37437 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1151,7 +1151,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
struct grid_cell tmp_gc, now_gc;
struct tty_ctx ttyctx;
u_int sx = screen_size_x(s), sy = screen_size_y(s);
- u_int width = gc->data.width, xx, last;
+ u_int width = gc->data.width, xx, last, cx, cy;
int selected, skip = 1;
/* Ignore padding cells. */
@@ -1163,10 +1163,12 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
if (width == 0) {
screen_write_collect_flush(ctx, 0);
if ((gc = screen_write_combine(ctx, &gc->data, &xx)) != 0) {
+ cx = s->cx; cy = s->cy;
screen_write_cursormove(ctx, xx, s->cy);
screen_write_initctx(ctx, &ttyctx);
ttyctx.cell = gc;
tty_write(tty_cmd_cell, &ttyctx);
+ s->cx = cx; s->cy = cy;
}
return;
}