From 5bcafebbd4556f2b7e3f345d1785c04369774b30 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Thu, 31 May 2007 13:56:35 +0000 Subject: Assume width 1 for control characters in places where a non-negative width is expected. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4535 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer-view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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 9c5f793e..8126898b 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -218,7 +218,7 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line) if (get_utf8_char(&next_ptr, char_len, &chr) < 0) char_len = 1; else - char_len = mk_wcwidth(chr); + char_len = unichar_isprint(chr) ? mk_wcwidth(chr) : 1; next_ptr++; } @@ -439,7 +439,7 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, if (get_utf8_char(&end, 6, &chr)<0) char_width = 1; else - char_width = mk_wcwidth(chr); + char_width = unichar_isprint(chr) ? mk_wcwidth(chr) : 1; } else { if (term_type == TERM_TYPE_BIG5 && is_big5(end[0], end[1])) -- cgit v1.2.3