From 9ba73ff740f3dc35a0aadd958535dea1cf7977b7 Mon Sep 17 00:00:00 2001 From: Hawtian Wang Date: Thu, 22 Feb 2024 18:13:12 +0800 Subject: [PATCH] fix: find raw_input from the end --- src/lsp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lsp.rs b/src/lsp.rs index e9624aa..486b4af 100644 --- a/src/lsp.rs +++ b/src/lsp.rs @@ -195,7 +195,7 @@ impl Backend { // prevent deleting puncts before real pinyin input let real_offset = new_offset + raw_input - .and_then(|rime_raw_input| new_input.borrow_pinyin().find(&rime_raw_input)) + .and_then(|rime_raw_input| new_input.borrow_pinyin().rfind(&rime_raw_input)) .unwrap_or(0); // candidates to completions