aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-07-27 11:33:21 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-07-27 11:33:21 +0000
commitfc65da1eed07708030c0ae491cb8f4a6614de390 (patch)
treeb194e1d04ac3b5a42ff1e1b992f27cfaaee0bdd6 /tty.c
parent584eda83397b262be01bddff31040e5cf4ff01a1 (diff)
downloadrtmux-fc65da1eed07708030c0ae491cb8f4a6614de390.tar.gz
rtmux-fc65da1eed07708030c0ae491cb8f4a6614de390.tar.bz2
rtmux-fc65da1eed07708030c0ae491cb8f4a6614de390.zip
Draw UTF-8 characters under the selection correctly.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tty.c b/tty.c
index 05342b82..48b10f7d 100644
--- a/tty.c
+++ b/tty.c
@@ -480,6 +480,7 @@ void
tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
{
const struct grid_cell *gc;
+ struct grid_cell tmpgc;
const struct grid_utf8 *gu;
u_int i, sx;
@@ -498,8 +499,10 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
gu = grid_view_peek_utf8(s->grid, i, py);
if (screen_check_selection(s, i, py)) {
- s->sel.cell.data = gc->data;
- tty_cell(tty, &s->sel.cell, gu);
+ memcpy(&tmpgc, &s->sel.cell, sizeof tmpgc);
+ tmpgc.data = gc->data;
+ tmpgc.flags = gc->flags;
+ tty_cell(tty, &tmpgc, gu);
} else
tty_cell(tty, gc, gu);
}