diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-10-23 17:13:10 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-10-23 17:13:10 +0000 |
commit | c643ac48278b793d17d0e8edd140af6d9d68128a (patch) | |
tree | fc972e85a483adfe0858d3a981d681dbbad783a0 /tty.c | |
parent | 97e02eae7d86c3c5b5c8610d3bd48c0fa1d0398e (diff) | |
download | rtmux-c643ac48278b793d17d0e8edd140af6d9d68128a.tar.gz rtmux-c643ac48278b793d17d0e8edd140af6d9d68128a.tar.bz2 rtmux-c643ac48278b793d17d0e8edd140af6d9d68128a.zip |
Sync OpenBSD patchset 420:
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 'tty.c')
-rw-r--r-- | tty.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.156 2009-10-23 17:11:26 tcunha Exp $ */ +/* $Id: tty.c,v 1.157 2009-10-23 17:13:10 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -879,14 +879,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 |