From: handa Date: Fri, 27 Oct 2006 12:12:23 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: REL-1-3-4~20 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9ac170f921ec674150b4ffbbed3c12155e68638f;p=m17n%2Fm17n-lib.git *** empty log message *** --- diff --git a/src/ChangeLog b/src/ChangeLog index ac283d3..98dbc45 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 diff --git a/src/input.c b/src/input.c index 7348d47..9338c3c 100644 --- a/src/input.c +++ b/src/input.c @@ -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) {