diff options
Diffstat (limited to 'src/PYPPhoneticEditor.cc')
-rw-r--r-- | src/PYPPhoneticEditor.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc index 0ef11d7..8141685 100644 --- a/src/PYPPhoneticEditor.cc +++ b/src/PYPPhoneticEditor.cc @@ -388,8 +388,12 @@ PhoneticEditor::selectCandidate (guint i) lookup_candidate_type_t type; pinyin_get_candidate_type (m_instance, candidate, &type); - if (BEST_MATCH_CANDIDATE == type) { - commit (); + if (NBEST_MATCH_CANDIDATE == type) { + /* as nbest match candidate starts from the beginning of user input. */ + pinyin_choose_candidate (m_instance, 0, candidate); + guint8 index = 0; + pinyin_get_candidate_nbest_index(m_instance, candidate, &index); + commit (index); return TRUE; } |