diff --git a/ibus-libzhuyin-1.7.x-HEAD.patch b/ibus-libzhuyin-1.7.x-HEAD.patch index 435458b..e69de29 100644 --- a/ibus-libzhuyin-1.7.x-HEAD.patch +++ b/ibus-libzhuyin-1.7.x-HEAD.patch @@ -1,81 +0,0 @@ -From f69aa02f2318dff8af34993f57c924e3b1514c2f Mon Sep 17 00:00:00 2001 -From: Peng Wu -Date: Fri, 11 Sep 2015 11:55:59 +0800 -Subject: [PATCH] fixes input behavior - ---- - src/ZYZPhoneticEditor.cc | 20 ++++++++++++++++++++ - src/ZYZPhoneticEditor.h | 5 +++++ - 2 files changed, 25 insertions(+) - -diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc -index 0672706..27b28be 100644 ---- a/src/ZYZPhoneticEditor.cc -+++ b/src/ZYZPhoneticEditor.cc -@@ -79,6 +79,8 @@ PhoneticEditor::PhoneticEditor (ZhuyinProperties & props, Config & config) - loadEasySymbolFile (path) || - loadEasySymbolFile (PKGDATADIR G_DIR_SEPARATOR_S "easysymbol.txt"); - g_free(path); -+ -+ m_moved_left = FALSE; - } - - PhoneticEditor::~PhoneticEditor (void) -@@ -122,6 +124,12 @@ PhoneticEditor::processEscape (guint keyval, guint keycode, - STATE_USER_SYMBOL_SHOWN == m_input_state) { - - m_input_state = STATE_INPUT; -+ -+ if (m_moved_left) { -+ moveCursorRight (); -+ m_moved_left = FALSE; -+ } -+ - update (); - return TRUE; - } -@@ -293,6 +301,12 @@ PhoneticEditor::processShowCandidateKey (guint keyval, guint keycode, - switch (keyval) { - case IBUS_Down: - case IBUS_KP_Down: -+ if (m_config.candidatesAfterCursor () && -+ m_cursor == get_enhanced_text_length (m_text)) { -+ moveCursorLeft (); -+ m_moved_left = TRUE; -+ } -+ - /* check phonetic or symbol section here */ - prepareCandidates (); - break; -@@ -301,6 +315,12 @@ PhoneticEditor::processShowCandidateKey (guint keyval, guint keycode, - case IBUS_KP_Up: - m_lookup_table.clear (); - m_input_state = STATE_INPUT; -+ -+ if (m_moved_left) { -+ moveCursorRight (); -+ m_moved_left = FALSE; -+ } -+ - break; - - default: -diff --git a/src/ZYZPhoneticEditor.h b/src/ZYZPhoneticEditor.h -index 9e178f8..bedb66c 100644 ---- a/src/ZYZPhoneticEditor.h -+++ b/src/ZYZPhoneticEditor.h -@@ -130,6 +130,11 @@ protected: - zhuyin_instance_vec m_instances; - - SymbolLookup m_easy_symbols; -+ -+ /* move left one character when cursor is at the end, -+ * only in candidates after cursor option. -+ */ -+ gboolean m_moved_left; - }; - - }; --- -2.4.3 -