Open FrankLeeC opened 2 months ago
In the Master
version, everything has been modified normally.
It will be applied to all next versions.
cursor_range.secondary.ccursor.index == state.ime_cursor_range.secondary.ccursor.index
The reason for checking is because the characters you are typing may be copied somewhere else.
In the
Master
version, everything has been modified normally.It will be applied to all next versions.
cursor_range.secondary.ccursor.index == state.ime_cursor_range.secondary.ccursor.index
The reason for checking is because the characters you are typing may be copied somewhere else.
Thank you! I 'll test in next version 😀
Describe the bug Sometimes can not type IME CompositionEnd characters.
To Reproduce Use 'PinYin' input, type some words, then type in some other character such as
【 】 ……
Expected behavior Type in any characters, including CompositionEnd characters.
Screenshots
https://github.com/emilk/egui/assets/16380650/fe9c1e7a-c665-4726-bf08-081b8c7c0c41
After typing
!@
, can not type any CompositionEnd character like【】。,;
。I'm using version 0.27.2, i see branch
master
has changedCompositionEnd
toImeEvent::Commit
, but this bug still exists. Here is why this happens./crates/egui/src/widgets/text_edit/builder.rs
L974if !prediction.is_empty() && cursor_range.secondary.ccursor.index == state.ime_cursor_range.secondary.ccursor.index
this prediction make surecursor_range.secondary.ccursor.index
equalsstate.ime_cursor_range.secondary.ccursor.index
. but when input CompositionEnd only characters after some other characters,cursor_range.secondary.ccursor.index
is equals to the length of previous characters, andstate.ime_cursor_range.secondary.ccursor.index
equals to0
.Below is my solution:
![IME-BUGFIX1](https://github.com/emilk/egui/assets/16380650/3dfc587b-08be-4705-ade9-8e4f6b598c4e)
https://github.com/emilk/egui/assets/16380650/6e2d7733-cea6-49e5-89ce-fd74e04963bc
If we check this two
cursors.index
only when ime_state equals true which meanings we triggeredCompositionStart
first and currently continue typing someIME
characters. if we triggerCompositionEnd
first, there is no need to checkcursor.index
.Actually, i don't know why need to check
cursor_range.secondary.ccursor.index == state.ime_cursor_range.secondary.ccursor.index
, can you tell me the reason. Thanks 😊Desktop (please complete the following information):