diff options
author | Peng Wu <alexepico@gmail.com> | 2011-11-07 15:09:46 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-12-22 12:23:15 +0800 |
commit | 7a10a4c189f8f28333c4bd8857a9bba4fd009a59 (patch) | |
tree | 44b06175525b45252a40d018930b83ae71b48eb5 /src/PYPPhoneticEditor.cc | |
parent | 2db3c83f7ed2dbcba3c579cfe9963577eaf58a59 (diff) | |
download | ibus-libpinyin-7a10a4c189f8f28333c4bd8857a9bba4fd009a59.tar.gz ibus-libpinyin-7a10a4c189f8f28333c4bd8857a9bba4fd009a59.tar.xz ibus-libpinyin-7a10a4c189f8f28333c4bd8857a9bba4fd009a59.zip |
show the rest of guessed sentence
Diffstat (limited to 'src/PYPPhoneticEditor.cc')
-rw-r--r-- | src/PYPPhoneticEditor.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc index b9dbc85..4f2c1e1 100644 --- a/src/PYPPhoneticEditor.cc +++ b/src/PYPPhoneticEditor.cc @@ -195,7 +195,7 @@ LibPinyinPhoneticEditor::fillLookupTableByPage (void) (m_candidates, phrase_token_t, i); if (null_token == *token) { - /* show guessed sentence. */ + /* show the rest of guessed sentence after the cursor. */ String buffer; char *tmp = NULL; pinyin_get_sentence(m_instance, &tmp); @@ -206,8 +206,10 @@ LibPinyinPhoneticEditor::fillLookupTableByPage (void) SimpTradConverter::simpToTrad (tmp, buffer); } } - Text text(buffer); - m_lookup_table.appendCandidate(text); + + guint lookup_cursor = getLookupCursor (); + gchar * rest = g_utf8_offset_to_pointer (buffer.c_str (), lookup_cursor); + m_lookup_table.appendCandidate (Text (rest)); g_free (tmp); continue; } |