From 5e7436b68dd39dac174014978a8c7de29595b674 Mon Sep 17 00:00:00 2001 From: shewer Date: Tue, 15 Aug 2023 21:43:53 +0800 Subject: [PATCH 1/2] fixed input : insert ch at caret_pos Signed-off-by: shewer --- src/rime/gear/recognizer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rime/gear/recognizer.cc b/src/rime/gear/recognizer.cc index 6ceffd603..9eabca3ae 100644 --- a/src/rime/gear/recognizer.cc +++ b/src/rime/gear/recognizer.cc @@ -88,7 +88,7 @@ ProcessResult Recognizer::ProcessKeyEvent(const KeyEvent& key_event) { // pattern matching against the input string plus the incoming character Context* ctx = engine_->context(); string input = ctx->input(); - input += ch; + input.insert(ctx->caret_pos(), 1, ch) ; auto match = patterns_.GetMatch(input, ctx->composition()); if (match.found()) { ctx->PushInput(ch); From 7857b2ed505a1b540addb34d83225e91ba711a29 Mon Sep 17 00:00:00 2001 From: shewer Date: Tue, 15 Aug 2023 21:47:17 +0800 Subject: [PATCH 2/2] fixed input : insert ch at caret_pos Signed-off-by: shewer --- src/rime/gear/recognizer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rime/gear/recognizer.cc b/src/rime/gear/recognizer.cc index 9eabca3ae..a469b2166 100644 --- a/src/rime/gear/recognizer.cc +++ b/src/rime/gear/recognizer.cc @@ -88,7 +88,7 @@ ProcessResult Recognizer::ProcessKeyEvent(const KeyEvent& key_event) { // pattern matching against the input string plus the incoming character Context* ctx = engine_->context(); string input = ctx->input(); - input.insert(ctx->caret_pos(), 1, ch) ; + input.insert(ctx->caret_pos(), 1, ch); auto match = patterns_.GetMatch(input, ctx->composition()); if (match.found()) { ctx->PushInput(ch);