Fix: IME bug when typing Chinese characters (#4210)

* Closes #4209 

Fix: IME bug when typing Chinese characters
This commit is contained in:
rustbasic 2024-03-22 20:27:08 +09:00 committed by GitHub
parent 769199648d
commit 21d045e8ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -953,7 +953,10 @@ fn events(
if prediction != "\n" && prediction != "\r" {
state.has_ime = false;
let mut ccursor;
if !prediction.is_empty() && cursor_range == state.ime_cursor_range {
if !prediction.is_empty()
&& cursor_range.secondary.ccursor.index
== state.ime_cursor_range.secondary.ccursor.index
{
ccursor = text.delete_selected(&cursor_range);
text.insert_text_at(&mut ccursor, prediction, char_limit);
} else {