diff --git a/honoka/src/honoka_imengine.cpp b/honoka/src/honoka_imengine.cpp index 5c5e772..6958fe7 100644 --- a/honoka/src/honoka_imengine.cpp +++ b/honoka/src/honoka_imengine.cpp @@ -679,20 +679,24 @@ } // Prediction if ((!m_conversion) && realtime_prediction && prediction && m_predictor->isConnected() && (!auto_conversion)) { - if (predictionDelay > 0) { + if ((predictionDelay > 0) && (preeditCache != m_preeditor->getText())) { + m_lookup_table.clear(); + m_lookup = false; preeditKeyDelay = HonokaTimer::self()->appendDelayEvent(predictionDelay); hide_lookup_table(); } else { - m_convList = m_predictor->getPredictionList(m_preeditor->getText()); - if (m_convList.count()) { - m_lookup_table.clear(); - for(unsigned int i = 0;i < m_convList.count();i ++) { - m_lookup_table.append_candidate(m_convList.kouho.at(i).kanji); + if (preeditCache != m_preeditor->getText()) { + m_convList = m_predictor->getPredictionList(m_preeditor->getText()); + if (m_convList.count()) { + m_lookup_table.clear(); + for(unsigned int i = 0;i < m_convList.count();i ++) { + m_lookup_table.append_candidate(m_convList.kouho.at(i).kanji); + } + startLookup(); + } else { + //m_lookup_table.clear(); + hide_lookup_table(); } - startLookup(); - } else { - //m_lookup_table.clear(); - hide_lookup_table(); } } } else hide_lookup_table(); @@ -707,7 +711,7 @@ } else { hide_aux_string(); } - + preeditCache = m_preeditor->getText(); updateProperty(); } /*! @@ -1594,7 +1598,10 @@ { // ���������ɽ�����롣 createLookupTable(m_convList); - if (m_convList.count() == 0) return; + if (m_convList.count() == 0) { + m_lookup = false; + return; + } m_lookup = true; update_aux_string(m_convList.Title + getPosPerCount(m_convList.pos,m_convList.count())); show_aux_string(); @@ -1637,7 +1644,10 @@ for(unsigned int i = 0;i < m_convList.count();i ++) { m_lookup_table.append_candidate(m_convList.kouho.at(i).kanji); } - if (w == m_preeditor->getText()) startLookup(); + if (w == m_preeditor->getText()) { + startLookup(); + hide_aux_string(); + } else hide_lookup_table(); } else { //m_lookup_table.clear(); diff --git a/honoka/src/honoka_imengine.h b/honoka/src/honoka_imengine.h index c0f9b43..0de226d 100644 --- a/honoka/src/honoka_imengine.h +++ b/honoka/src/honoka_imengine.h @@ -150,6 +150,7 @@ ACPredictor *acpredictor; int preeditKeyDelay; uint32 predictionDelay; + WideString preeditCache; protected: bool process_preedit_key_event(const KeyEvent &key); bool process_conversion_key_event(const KeyEvent &key);