mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 08:02:13 +02: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:
parent
a266ce8d97
commit
6c0463fbf7
1 changed files with 2 additions and 9 deletions
|
|
@ -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);
|
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)
|
void gui_entry_erase(GUI_ENTRY_REC *entry, int size, int update_cutbuffer)
|
||||||
{
|
{
|
||||||
size_t w = 0;
|
size_t w = 0;
|
||||||
|
|
@ -570,7 +562,8 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, int update_cutbuffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->utf8)
|
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,
|
g_memmove(entry->text + entry->pos - size, entry->text + entry->pos,
|
||||||
(entry->text_len-entry->pos+1) * sizeof(unichar));
|
(entry->text_len-entry->pos+1) * sizeof(unichar));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue