From 7eb2fc70e38ee3d5809d5171b3e38012ece7cb9e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 19 Oct 2003 19:09:51 +0000 Subject: BIG5 fixes by vanilla@FreeBSD.org(?) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3134 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer-view.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/fe-text/textbuffer-view.c') diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index 8eddae2f..589e2c91 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -199,8 +199,12 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line) } if (!view->utf8) { - next_ptr = ptr+1; - char_len = 1; + /* MH */ + if (ptr[1] == '\0' || !is_big5(ptr[0], ptr[1])) + char_len = 1; + else + char_len = 2; + next_ptr = ptr+char_len; } else { char_len = 1; while (ptr[char_len] != '\0' && char_len < 6) @@ -251,7 +255,11 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line) continue; } - if (*ptr == ' ') { + if (!view->utf8 && char_len > 1) { + last_space = xpos; + last_space_ptr = next_ptr; + last_color = color; + } else if (*ptr == ' ') { last_space = xpos; last_space_ptr = ptr; last_color = color; -- cgit v1.2.3