Conversation
|
I confirmed this change won't break the Japanese input by testing following examples with Pop!_OS 24.04, macOS and Windows:
(EDIT: this change is OK on Windows too. I experienced link.exe error, that was because I forgotten installing required Windows SDK components.) |
| vec![ | ||
| text::Span::new(&preedit.content[..selection.start]), | ||
| text::Span::new(if selection.start == selection.end { | ||
| text::Span::new(if selection.start >= selection.end { |
There was a problem hiding this comment.
Here, the input_method::Preedit.selection value comes from winit's Preedit event.
https://docs.rs/winit/latest/winit/event/enum.Ime.html#variant.Preedit
The winit's Preedit event doesn't specify negative Range specifically, and
https://doc.rust-lang.org/std/ops/struct.Range.html
It is empty if
start >= end.
Range document says negative Range means the range is empty, so this change looks correct for me.
|
I commented this PR as a contributor in this area to help the library author understanding this change. As I don't have merge right, please wait for the devs reviewing your change. |
|
thanks, it may also needs merge to 0.14 release and build out a package. |
I made a fix myself, please review and merge.