summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-12-04 14:15:02 +0800
committerPeng Wu <alexepico@gmail.com>2015-12-04 14:15:02 +0800
commite94fe7e9209ce7bc53afb8095ea27a36d3293616 (patch)
tree533ec2c5fd2727ae732b96fbb3c65011867bcc91
parent73d10ca81032b535a05bf2fbfe0a9df905f3b1ef (diff)
downloadibus-libzhuyin-e94fe7e9209ce7bc53afb8095ea27a36d3293616.tar.gz
ibus-libzhuyin-e94fe7e9209ce7bc53afb8095ea27a36d3293616.tar.xz
ibus-libzhuyin-e94fe7e9209ce7bc53afb8095ea27a36d3293616.zip
fixes getCursorRight method
-rw-r--r--src/ZYZPhoneticEditor.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc
index 74c7d70..62e9c59 100644
--- a/src/ZYZPhoneticEditor.cc
+++ b/src/ZYZPhoneticEditor.cc
@@ -728,6 +728,12 @@ PhoneticEditor::getCursorRight (void)
size_t index = 0;
size_t start_pos = 0, end_pos = 0;
+ size_t total_length = get_enhanced_text_length (enhanced_text);
+
+ /* near the end of enhanced text length. */
+ if (m_cursor + 1 >= total_length)
+ return total_length;
+
probe_section_start (enhanced_text, m_cursor,
cursor, index, start_pos);