*** empty log message ***
authorhanda <handa>
Fri, 27 Oct 2006 12:12:23 +0000 (12:12 +0000)
committerhanda <handa>
Fri, 27 Oct 2006 12:12:23 +0000 (12:12 +0000)
src/ChangeLog
src/input.c

index ac283d3..98dbc45 100644 (file)
@@ -3,6 +3,7 @@
        * input.c (marker_code): New arg surrounding.  Callers changed.
        (surrounding_pos): Check if name[0] == '@'.
        (integer_value): Fix for the change semantics of `@-N' and `@+N'.
+       (take_action_list): Likewise.
 
 2006-10-19  Kenichi Handa  <handa@m17n.org>
 
index 7348d47..9338c3c 100644 (file)
@@ -2954,6 +2954,17 @@ take_action_list (MInputContext *ic, MPlist *action_list)
              && (pos = surrounding_pos (MPLIST_SYMBOL (args))) != 0)
            {
              delete_surrounding_text (ic, pos);
+             to = ic->cursor_pos + pos;
+             if (to < 0)
+               {
+                 delete_surrounding_text (ic, to);
+                 to = 0;
+               }
+             else if (to > len)
+               {
+                 delete_surrounding_text (ic, to - len);
+                 to = len;
+               }
            }
          else
            {
@@ -2965,12 +2976,12 @@ take_action_list (MInputContext *ic, MPlist *action_list)
                to = 0;
              else if (to > len)
                to = len;
-             MDEBUG_PRINT1 ("(%d)", to - ic->cursor_pos);
-             if (to < ic->cursor_pos)
-               preedit_delete (ic, to, ic->cursor_pos);
-             else if (to > ic->cursor_pos)
-               preedit_delete (ic, ic->cursor_pos, to);
            }
+         MDEBUG_PRINT1 ("(%d)", to - ic->cursor_pos);
+         if (to < ic->cursor_pos)
+           preedit_delete (ic, to, ic->cursor_pos);
+         else if (to > ic->cursor_pos)
+           preedit_delete (ic, ic->cursor_pos, to);
        }
       else if (name == Mmove)
        {