diff options
author | Vanilla I. Shu <vanilla@FreeBSD.org> | 2001-11-02 05:42:46 +0000 |
---|---|---|
committer | Vanilla I. Shu <vanilla@FreeBSD.org> | 2001-11-02 05:42:46 +0000 |
commit | 42a62655d7c1896805c75fe6cee1a9d5d15c8daa (patch) | |
tree | 73e63b1b5f5ee639f9635c7d22849f03c8ad3ea3 /chinese/irssi | |
parent | 1c66a6524f3b247d2d76a8a0e0dac9e6866de1be (diff) |
a patch for big5 charset cursor movement/backspace.
Submitted by: mhsin@mhsin.org
Notes
Notes:
svn path=/head/; revision=49483
Diffstat (limited to 'chinese/irssi')
-rw-r--r-- | chinese/irssi/files/patch-src_fe-text_gui-entry.c | 38 |
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 + |