--with-big5 enables Chinese Big5 charset support. Patch by vanilla@freebsd.org

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1458 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-05-01 09:38:06 +00:00 committed by cras
commit 6d4f2ab6fa
3 changed files with 48 additions and 0 deletions

View file

@ -152,6 +152,11 @@ void gui_entry_erase(int size)
{
if (pos < size) return;
#ifdef WANT_BIG5
if (is_big5(entry->str[pos-2], entry->str[pos-1]))
size++;
#endif WANT_BIG5
pos -= size;
g_string_erase(entry, pos, size);
@ -217,6 +222,13 @@ void gui_entry_set_pos(int p)
void gui_entry_move_pos(int p)
{
#ifdef WANT_BIG5
if (p > 0 && is_big5 (entry->str[pos], entry->str[pos+1]))
p++;
else if (p < 0 && is_big5 (entry->str[pos-1], entry->str[pos]))
p--;
#endif WANT_BIG5
if (pos+p >= 0 && pos+p <= entry->len)
pos += p;