summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-08-19 11:36:26 +0800
committerPeng Wu <alexepico@gmail.com>2015-08-19 11:36:26 +0800
commit0ddb44c55238cbaa431aa1f525e8625563830d2a (patch)
tree345c865f302e0ec5aefa2d9f8bae94a9ab0d1e6b
parentb3744fe3546dbe7a71007d5d8a27194ab279b8cd (diff)
downloadibus-libzhuyin-0ddb44c55238cbaa431aa1f525e8625563830d2a.tar.gz
ibus-libzhuyin-0ddb44c55238cbaa431aa1f525e8625563830d2a.tar.xz
ibus-libzhuyin-0ddb44c55238cbaa431aa1f525e8625563830d2a.zip
fixes updateZhuyin method1.7.4
-rw-r--r--src/ZYZZhuyinEditor.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ZYZZhuyinEditor.cc b/src/ZYZZhuyinEditor.cc
index 9fb2709..7593f62 100644
--- a/src/ZYZZhuyinEditor.cc
+++ b/src/ZYZZhuyinEditor.cc
@@ -73,6 +73,7 @@ ZhuyinEditor::updateZhuyin (void)
static const char * tones[] = {" ", "ˊ", "ˇ", "ˋ", "˙", NULL};
const String & enhanced_text = m_text;
+ const size_t text_len = get_enhanced_text_length (enhanced_text);
String new_text;
size_t append_offset = 0;
@@ -111,7 +112,7 @@ ZhuyinEditor::updateZhuyin (void)
/* check whether the last character is tone,
if not part of parsed chewing input,
turn the tone into symbol. */
- if (end_pos == m_text.size ()) {
+ if (m_cursor == text_len && end_pos == m_text.size ()) {
/* check tone symbol. */
const char tone = section[section.size () - 1];