diff --git a/scim-wnn/src/scim_wnn_imengine.cpp b/scim-wnn/src/scim_wnn_imengine.cpp index f035f13..326b830 100644 --- a/scim-wnn/src/scim_wnn_imengine.cpp +++ b/scim-wnn/src/scim_wnn_imengine.cpp @@ -476,17 +476,24 @@ if (m_lookup) { char numk[] = "1234567890"; int numc = 0; - for(;numk[numc]; ++ numc) - if (key.get_ascii_code() == numk[numc]) break; - if (m_lookup_table.get_current_page_size() < numc) return(true); - m_convList.pos = numc + m_lookup_table.get_current_page_start(); - wnn.select(m_convList.pos); - wnn.setPos(wnn.getPos() + 1); - m_convList = wnn.getConversionList(); - update_preedit_string(wnn.getText(),wnn.getAttributeList()); - update_preedit_caret(wnn.getCaretPos()); - startLookup(); - return(true); + bool numkey = false; + for(;numk[numc]; ++ numc) { + if (key.get_ascii_code() == numk[numc]) { + numkey = true; + break; + } + } + if (numkey) { + if (m_lookup_table.get_current_page_size() < numc) return(true); + m_convList.pos = numc + m_lookup_table.get_current_page_start(); + wnn.select(m_convList.pos); + wnn.setPos(wnn.getPos() + 1); + m_convList = wnn.getConversionList(); + update_preedit_string(wnn.getText(),wnn.getAttributeList()); + update_preedit_caret(wnn.getCaretPos()); + startLookup(); + return(true); + } } commit_string(wnn.getText());