Skip to content

fix #3232#3253

Open
jeffreyniu wants to merge 1 commit intoiced-rs:masterfrom
jeffreyniu:fix3232
Open

fix #3232#3253
jeffreyniu wants to merge 1 commit intoiced-rs:masterfrom
jeffreyniu:fix3232

Conversation

@jeffreyniu
Copy link

I made a fix myself, please review and merge.

@kenz-gelsoft
Copy link
Contributor

kenz-gelsoft commented Feb 16, 2026

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kenz-gelsoft
Copy link
Contributor

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.

@jeffreyniu
Copy link
Author

thanks, it may also needs merge to 0.14 release and build out a package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants