From 0a050d2be708319c2d52d33e626f3a06aa49f001 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 8 Dec 2017 10:49:56 +0800 Subject: fixes getCursorLeft method --- src/ZYZPhoneticEditor.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc index 0c1ffa9..32a0f0a 100644 --- a/src/ZYZPhoneticEditor.cc +++ b/src/ZYZPhoneticEditor.cc @@ -705,6 +705,10 @@ PhoneticEditor::getCursorLeft (void) size_t offset = 0; zhuyin_get_zhuyin_offset (instance, cursor, &offset); + /* cursor moved already */ + if (cursor != offset) + return m_cursor - (cursor + 1) + offset; + size_t left = 0; zhuyin_get_left_zhuyin_offset(instance, offset, &left); -- cgit