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
This commit is contained in:
Emanuele Giaquinta 2007-05-31 13:56:35 +00:00 committed by exg
commit 5bcafebbd4
4 changed files with 7 additions and 7 deletions

View file

@ -166,7 +166,7 @@ static int pos2scrpos(GUI_ENTRY_REC *entry, int pos)
if (term_type == TERM_TYPE_BIG5)
xpos += big5_width(*p);
else if (entry->utf8)
xpos += mk_wcwidth(*p);
xpos += unichar_isprint(*p) ? mk_wcwidth(*p) : 1;
else
xpos++;
}
@ -183,7 +183,7 @@ static int scrpos2pos(GUI_ENTRY_REC *entry, int pos)
if (term_type == TERM_TYPE_BIG5)
width = big5_width(*p);
else if (entry->utf8)
width = mk_wcwidth(*p);
width = unichar_isprint(*p) ? mk_wcwidth(*p) : 1;
else
width = 1;
@ -248,7 +248,7 @@ static void gui_entry_draw_from(GUI_ENTRY_REC *entry, int pos)
else if (term_type == TERM_TYPE_BIG5)
xpos += big5_width(*p);
else if (entry->utf8)
xpos += mk_wcwidth(*p);
xpos += unichar_isprint(*p) ? mk_wcwidth(*p) : 1;
else
xpos++;