mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Fix: IME bug when typing Chinese characters (#4210)
* Closes #4209 Fix: IME bug when typing Chinese characters
This commit is contained in:
@@ -953,7 +953,10 @@ fn events(
|
|||||||
if prediction != "\n" && prediction != "\r" {
|
if prediction != "\n" && prediction != "\r" {
|
||||||
state.has_ime = false;
|
state.has_ime = false;
|
||||||
let mut ccursor;
|
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);
|
ccursor = text.delete_selected(&cursor_range);
|
||||||
text.insert_text_at(&mut ccursor, prediction, char_limit);
|
text.insert_text_at(&mut ccursor, prediction, char_limit);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user