diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-27 11:33:22 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-07-27 11:33:22 +0000 |
commit | 55ba15894d6cfa42867db856cd82331450ae5248 (patch) | |
tree | 0105f467e3c172f2891c49c2b85455d34f188195 /usr.bin/tmux/tty.c | |
parent | 03c7d1193db9d2be84b3bda312af139ce6fa0b2e (diff) |
Draw UTF-8 characters under the selection correctly.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 7a05fe6afc7..e7678a89e70 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.15 2009/07/22 20:56:58 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.16 2009/07/27 11:33:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); } |