1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-13 05:03:45 -04:00

Manually inline cell_width.

git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4942 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-12-03 20:14:58 +00:00 committed by exg
parent a266ce8d97
commit 6c0463fbf7

View File

@ -539,14 +539,6 @@ void gui_entry_erase_to(GUI_ENTRY_REC *entry, int pos, int update_cutbuffer)
gui_entry_erase(entry, size, update_cutbuffer);
}
static size_t cell_width(unichar *buf, int len)
{
unichar *str = buf;
while (len-- && mk_wcwidth(*str--) == 0);
return buf - str;
}
void gui_entry_erase(GUI_ENTRY_REC *entry, int size, int update_cutbuffer)
{
size_t w = 0;
@ -570,7 +562,8 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, int update_cutbuffer)
}
if (entry->utf8)
w = cell_width(entry->text + entry->pos - size, entry->pos - size + 1)-1;
while (entry->pos-size-w > 0 &&
mk_wcwidth(entry->text[entry->pos-size-w]) == 0) w++;
g_memmove(entry->text + entry->pos - size, entry->text + entry->pos,
(entry->text_len-entry->pos+1) * sizeof(unichar));