File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ void Context::Clear() {
110110 update_notifier_ (this );
111111}
112112
113+ void Context::AbortComposition () {
114+ Clear ();
115+ abort_notifier_ (this );
116+ }
117+
113118bool Context::Select (size_t index) {
114119 if (composition_.empty ())
115120 return false ;
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ class RIME_DLL Context {
4141 bool PopInput (size_t len = 1 );
4242 bool DeleteInput (size_t len = 1 );
4343 void Clear ();
44+ // Clear and notify abort
45+ void AbortComposition ();
4446
4547 // return false if there is no candidate at index
4648 bool Select (size_t index);
@@ -84,6 +86,7 @@ class RIME_DLL Context {
8486 Notifier& select_notifier () { return select_notifier_; }
8587 Notifier& update_notifier () { return update_notifier_; }
8688 Notifier& delete_notifier () { return delete_notifier_; }
89+ Notifier& abort_notifier () { return abort_notifier_; }
8790 OptionUpdateNotifier& option_update_notifier () {
8891 return option_update_notifier_;
8992 }
@@ -106,6 +109,7 @@ class RIME_DLL Context {
106109 Notifier select_notifier_;
107110 Notifier update_notifier_;
108111 Notifier delete_notifier_;
112+ Notifier abort_notifier_;
109113 OptionUpdateNotifier option_update_notifier_;
110114 PropertyUpdateNotifier property_update_notifier_;
111115 KeyEventNotifier unhandled_key_notifier_;
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ bool Session::CommitComposition() {
4545void Session::ClearComposition () {
4646 if (!engine_)
4747 return ;
48- engine_->context ()->Clear ();
48+ engine_->context ()->AbortComposition ();
4949}
5050
5151void Session::ApplySchema (Schema* schema) {
You can’t perform that action at this time.
0 commit comments