Similar to the deletion (backspace/delete) in #693 but a bit more complex to fix.
This affects at least move_left/move_right but likely also others like shift selection, clicking to select a cursor position,...
When moving the cursor it ends up in the middle of graphemes, taking as many steps to step through as it has codepoints to get to the other side.
The reason this is harder to fix is that the LayoutContext is not available from Cursor::next_visual and similar places, just &Layout so we can't easily reach the ICU grapheme segmenter. Since that would be a bigger API change I did not make a PR for this but just an issue. The shaper already computes grapheme cluster boundaries so this is more a question of the desired API shape.
Similar to the deletion (backspace/delete) in #693 but a bit more complex to fix.
This affects at least move_left/move_right but likely also others like shift selection, clicking to select a cursor position,...
When moving the cursor it ends up in the middle of graphemes, taking as many steps to step through as it has codepoints to get to the other side.
The reason this is harder to fix is that the LayoutContext is not available from Cursor::next_visual and similar places, just &Layout so we can't easily reach the ICU grapheme segmenter. Since that would be a bigger API change I did not make a PR for this but just an issue. The shaper already computes grapheme cluster boundaries so this is more a question of the desired API shape.