aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/irssi
diff options
context:
space:
mode:
authorvanilla <vanilla@FreeBSD.org>2001-11-02 13:42:46 +0800
committervanilla <vanilla@FreeBSD.org>2001-11-02 13:42:46 +0800
commite79e577337dd5116418d91afa75ced4c3630d49a (patch)
tree5cf456f19669bbc027bf7ee79482843971132aea /chinese/irssi
parent9650612b5c5d71a315e6b6be088c6b4a4c6f4bea (diff)
downloadfreebsd-ports-gnome-e79e577337dd5116418d91afa75ced4c3630d49a.tar.gz
freebsd-ports-gnome-e79e577337dd5116418d91afa75ced4c3630d49a.tar.zst
freebsd-ports-gnome-e79e577337dd5116418d91afa75ced4c3630d49a.zip
a patch for big5 charset cursor movement/backspace.
Submitted by: mhsin@mhsin.org
Diffstat (limited to 'chinese/irssi')
-rw-r--r--chinese/irssi/files/patch-src_fe-text_gui-entry.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/chinese/irssi/files/patch-src_fe-text_gui-entry.c b/chinese/irssi/files/patch-src_fe-text_gui-entry.c
index e6a65fcaaf47..51b6a7876861 100644
--- a/chinese/irssi/files/patch-src_fe-text_gui-entry.c
+++ b/chinese/irssi/files/patch-src_fe-text_gui-entry.c
@@ -1,25 +1,49 @@
---- src/fe-text/gui-entry.c.orig Fri Apr 27 19:13:05 2001
-+++ src/fe-text/gui-entry.c Fri Apr 27 22:30:26 2001
-@@ -152,6 +152,11 @@
+--- gui-entry.c.orig Sun Mar 4 02:04:10 2001
++++ gui-entry.c Thu Nov 1 23:38:28 2001
+@@ -148,10 +148,35 @@
+ entry_update();
+ }
+
++#ifdef WANT_BIG5
++int gui_is_big5(char *str, int pos)
++{
++ int a;
++
++ if(pos < 0)
++ return 0;
++ for(a = 0; a < pos;)
++ {
++ if(str[0] == '\0')
++ break;
++ if(is_big5(str[a], str[a + 1]))
++ a += 2;
++ else
++ a ++;
++ }
++ return ((a == pos) && is_big5(str[a], str[a + 1]));
++}
++#endif WANT_BIG5
++
+ void gui_entry_erase(int size)
{
if (pos < size) return;
+#ifdef WANT_BIG5
-+ if (is_big5(entry->str[pos-2], entry->str[pos-1]))
++ if (gui_is_big5(entry->str, pos - 2))
+ size++;
+#endif WANT_BIG5
+
pos -= size;
g_string_erase(entry, pos, size);
-@@ -217,6 +222,13 @@
+@@ -217,6 +242,13 @@
void gui_entry_move_pos(int p)
{
+#ifdef WANT_BIG5
-+ if (p > 0 && is_big5 (entry->str[pos], entry->str[pos+1]))
++ if (p > 0 && gui_is_big5(entry->str, pos))
+ p++;
-+ else if (p < 0 && is_big5 (entry->str[pos-1], entry->str[pos]))
++ else if (p < 0 && gui_is_big5(entry->str, pos - 2))
+ p--;
+#endif WANT_BIG5
+