diff options
author | Peng Wu <alexepico@gmail.com> | 2019-04-25 13:59:45 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2019-04-25 13:59:45 +0800 |
commit | 1ec2814cd1df22e742261ed252d6e4f5a645a76f (patch) | |
tree | 0cdd4abd012c77f23c0cafb45c2334720bc1204e | |
parent | a9f5f78914d41ad3fecd6ca9d5396c65d2d15a71 (diff) | |
download | ibus-libzhuyin-1ec2814cd1df22e742261ed252d6e4f5a645a76f.tar.gz ibus-libzhuyin-1ec2814cd1df22e742261ed252d6e4f5a645a76f.tar.xz ibus-libzhuyin-1ec2814cd1df22e742261ed252d6e4f5a645a76f.zip |
fixes escape handling
-rw-r--r-- | src/ZYEditor.cc | 3 | ||||
-rw-r--r-- | src/ZYZPhoneticEditor.cc | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/ZYEditor.cc b/src/ZYEditor.cc index 5143c4c..08bb2ac 100644 --- a/src/ZYEditor.cc +++ b/src/ZYEditor.cc @@ -98,6 +98,9 @@ Editor::processKeyEvent (guint keyval, guint keycode, guint modifiers) } return TRUE; case IBUS_Escape: + if (m_text.empty ()) + return FALSE; + reset (); return TRUE; default: diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc index a506a1b..55fbcae 100644 --- a/src/ZYZPhoneticEditor.cc +++ b/src/ZYZPhoneticEditor.cc @@ -108,6 +108,9 @@ PhoneticEditor::processEscape (guint keyval, guint keycode, if (IBUS_Escape != keyval) return FALSE; + if (m_text.empty ()) + return FALSE; + if (cmshm_filter (modifiers) != 0) return TRUE; |