Skip to content

Commit

Permalink
Merge pull request #21 from TwIStOy/master
Browse files Browse the repository at this point in the history
fix: find raw_input from the end
  • Loading branch information
wlh320 authored Feb 23, 2024
2 parents 375b444 + a8b19cd commit 2d6e765
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ 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(utils::option_string)
.and_then(|rime_raw_input| new_input.borrow_pinyin().rfind(&rime_raw_input))
.unwrap_or(0);

// candidates to completions
Expand Down

0 comments on commit 2d6e765

Please sign in to comment.