From 9005c408e8a10f40ea205a7a569e994c778d409f Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 15 Oct 2009 08:15:09 +0000 Subject: [PATCH] *** empty log message *** --- MInputMethod.cs | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/MInputMethod.cs b/MInputMethod.cs index be452c1..c2da081 100644 --- a/MInputMethod.cs +++ b/MInputMethod.cs @@ -822,10 +822,9 @@ namespace M17N.Input | CandidateAll); } - // Fill the array "group" by candidates stating from INDEX. - // INDEX must be a multiple of "column". Set NTIMES to the - // number of valid candidates in "group". Update "block" if - // necessary. Return "group". + // Fill the array "group" by candidates stating from START. + // START must be a multiple of "column". Return the number of + // valid candidates in "group". private int fill_group (int start) { @@ -953,6 +952,13 @@ namespace M17N.Input col = maxcol; index = index - Column + col; } + + public override string ToString () + { + return (String.Format ("", row, index) + + Group + + ""); + } } internal class Selector : Xex.TermValue @@ -2333,6 +2339,11 @@ namespace M17N.Input private void set_cursor (string prefix, int pos) { cursor_pos = pos; + if (cursor_pos > 0) + candidates = (Candidates) preedit.GetProp (cursor_pos - 1, + Mcandidates); + else + candidates = null; } internal void reset () @@ -2444,7 +2455,7 @@ namespace M17N.Input changed |= ChangedStatus.Preedit | ChangedStatus.CursorPos; } - private void update_candidate () + private void update_candidate (Candidates candidates) { object candidate = candidates.Current; @@ -2458,8 +2469,6 @@ namespace M17N.Input preedit_replace (candidate_from, candidate_to, (int) candidate); candidate_to = candidate_from + 1; } - preedit.PushProp (candidate_from, candidate_to, - Mcandidates, this); set_cursor ("update-candidate", candidate_to); changed |= (ChangedStatus.Preedit | ChangedStatus.CursorPos | CandidateAll); @@ -2469,7 +2478,7 @@ namespace M17N.Input { this.candidates = candidates; candidate_from = candidate_to = cursor_pos; - update_candidate (); + update_candidate (candidates); } internal void select (int n) @@ -2477,7 +2486,7 @@ namespace M17N.Input if (candidates != null) { candidates.Select (n); - update_candidate (); + update_candidate (null); } } -- 1.7.10.4