From: Peng Wu Date: Tue, 22 Jun 2010 10:08:00 +0000 (+0800) Subject: fixes space and m_cursor handles. X-Git-Tag: 1.3.10~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83a549ad0dd6872fcea509df02666b5cb6488324;p=platform%2Fupstream%2Fibus-libpinyin.git fixes space and m_cursor handles. --- diff --git a/src/ExtEditor.cc b/src/ExtEditor.cc index fd7dad3..91e4994 100644 --- a/src/ExtEditor.cc +++ b/src/ExtEditor.cc @@ -269,11 +269,11 @@ ExtEditor::processSpace (guint keyval) case LABEL_LIST_COMMANDS: case LABEL_LIST_DIGIT: case LABEL_LIST_ALPHA: - selectCandidateInPage (cursor_pos); + selectCandidate (cursor_pos); break; case LABEL_LIST_SINGLE: g_return_val_if_fail (cursor_pos == 0 , FALSE); - selectCandidateInPage (cursor_pos); + selectCandidate (cursor_pos); break; default: break; @@ -421,6 +421,7 @@ ExtEditor::selectCandidate (guint index) m_text.clear (); m_text = "i"; m_text += command->command_name; + m_cursor = m_text.length (); break; } } @@ -442,6 +443,7 @@ ExtEditor::selectCandidate (guint index) m_text.clear (); } else if (candidate->suggest) { m_text += candidate->suggest; + m_cursor += strlen(candidate->suggest); } updateStateFromInput ();