summaryrefslogtreecommitdiff
path: root/src/fe-text/gui-entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-text/gui-entry.c')
-rw-r--r--src/fe-text/gui-entry.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c
index f60525b9..7544539a 100644
--- a/src/fe-text/gui-entry.c
+++ b/src/fe-text/gui-entry.c
@@ -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;