summaryrefslogtreecommitdiff
path: root/src/fe-text/textbuffer-view.c
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-05-31 13:56:35 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-05-31 13:56:35 +0000
commit5bcafebbd4556f2b7e3f345d1785c04369774b30 (patch)
tree3c7def4a8423391bd4075d4e60ae5754177948f0 /src/fe-text/textbuffer-view.c
parentd3687d8a973e507db22e1565592c5ebdd7b017c4 (diff)
downloadirssi-5bcafebbd4556f2b7e3f345d1785c04369774b30.zip
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
Diffstat (limited to 'src/fe-text/textbuffer-view.c')
-rw-r--r--src/fe-text/textbuffer-view.c4
1 files changed, 2 insertions, 2 deletions
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]))