diff options
author | 2009-10-20 17:33:33 +0000 | |
---|---|---|
committer | 2009-10-20 17:33:33 +0000 | |
commit | e91c0c387a3b51d3c240f8ca2e1a9ecbfc770800 (patch) | |
tree | 6d828cd9bb274f9be0bfda47a39b7f9a631f36a1 /usr.bin/tmux/tty.c | |
parent | Move the check for whether to force a line wrapper lower down into the tty code (diff) | |
download | wireguard-openbsd-e91c0c387a3b51d3c240f8ca2e1a9ecbfc770800.tar.xz wireguard-openbsd-e91c0c387a3b51d3c240f8ca2e1a9ecbfc770800.zip |
UTF-8 combined character fixes.
Thai can have treble combinations (1 x width=1 then 2 x width=0) so bump the
UTF-8 cell data size to 9 and alter the code to allow this.
Also break off the combining code into a separate function, handle any further
combining beyond the buffer size by replacing the character with _s, and when
redrawing the UTF-8 character don't assume the first part has just been
printed, redraw the entire line.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index d2d1490adb6..bba5c95b281 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.52 2009/10/20 16:32:23 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.53 2009/10/20 17:33:33 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -874,14 +874,13 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx) void tty_cmd_utf8character(struct tty *tty, const struct tty_ctx *ctx) { - u_char *ptr = ctx->ptr; - size_t i; + struct window_pane *wp = ctx->wp; - for (i = 0; i < UTF8_SIZE; i++) { - if (ptr[i] == 0xff) - break; - tty_putc(tty, ptr[i]); - } + /* + * Cannot rely on not being a partial character, so just redraw the + * whole line. + */ + tty_draw_line(tty, wp->screen, ctx->ocy, wp->xoff, wp->yoff); } void |