From 9ac170f921ec674150b4ffbbed3c12155e68638f Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 27 Oct 2006 12:12:23 +0000 Subject: [PATCH] *** empty log message *** --- src/ChangeLog | 1 + src/input.c | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) 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) { -- 1.7.10.4