From: mogami Date: Tue, 21 Oct 2003 13:31:37 +0000 (+0000) Subject: util.c 1.50 の askfor_aux() の修正(左カーソル移動とバックスペース)をautopick.cの検索文字列入力のコードに適用するを忘れていたので今適用。 X-Git-Tag: v2.1.2~981 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3299ee0894526f3564ee43a4b83e07b10732592e;p=hengband%2Fhengband.git util.c 1.50 の askfor_aux() の修正(左カーソル移動とバックスペース)をautopick.cの検索文字列入力のコードに適用するを忘れていたので今適用。 --- diff --git a/src/autopick.c b/src/autopick.c index f41d43414..7080b5b8d 100644 --- a/src/autopick.c +++ b/src/autopick.c @@ -3238,18 +3238,37 @@ static byte get_string_for_search(object_type **o_handle, cptr *search_strp) break; case '\010': + { /* Backspace */ + int i = 0; + /* Now on insert mode */ color = TERM_WHITE; /* No move at biggining of line */ - if (!pos) break; + if (0 == pos) break; - /* Go left 1 unit */ - pos--; + while (TRUE) + { + int next_pos = i + 1; + +#ifdef JP + if (iskanji(buf[i])) next_pos++; +#endif + + /* Is there the cursor at next position? */ + if (next_pos >= pos) break; + + /* Move to next */ + i = next_pos; + } + + /* Get previous position */ + pos = i; /* Fall through to 'Delete key' */ + } case 0x7F: case KTRL('d'): @@ -3265,7 +3284,7 @@ static byte get_string_for_search(object_type **o_handle, cptr *search_strp) #ifdef JP /* Next character is one more byte away */ - if (iskanji(src)) src++; + if (iskanji(buf[pos])) src++; #endif dst = pos;