From e88bd3132328cbd80d39ad8f95b308e2d20d04d1 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Mon, 21 Apr 2008 20:44:04 +0000 Subject: [PATCH] Use term_add_unichar to print ucs-4 chars. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4812 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer-view.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index da0a16f7..0c490592 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -437,7 +437,6 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, if (view->utf8) { chr = read_unichar(text, &end, &char_width); - end--; } else { chr = *text; end = text; @@ -446,15 +445,17 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, char_width = 2; else char_width = 1; - end += char_width-1; + end += char_width; } xpos += char_width; if (xpos <= term_width) { if (unichar_isprint(chr)) { + if (view->utf8) + term_add_unichar(view->window, chr); + else for (; text < end; text++) term_addch(view->window, *text); - term_addch(view->window, *text); } else { /* low-ascii */ term_set_color(view->window, ATTR_RESET|ATTR_REVERSE); @@ -462,7 +463,7 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, term_set_color(view->window, color); } } - text++; + text = end; } if (need_clrtoeol && xpos < term_width) {