From f8696d258fffc272ee59f49315807c26b44d8658 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 12 Dec 2017 12:08:29 +0800 Subject: clean getCursorLeft method --- src/ZYZPhoneticEditor.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/ZYZPhoneticEditor.cc') diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc index 32a0f0a..b4001f6 100644 --- a/src/ZYZPhoneticEditor.cc +++ b/src/ZYZPhoneticEditor.cc @@ -705,16 +705,9 @@ 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); - /* align to the begin of chewing key. */ /* restore cursor variable. */ - return m_cursor - (cursor + 1) + left; + return m_cursor - (cursor + 1) + offset; } } -- cgit