Skip to content

Cursor motion steps are codepoints, not grapheme clusters #694

Description

@taladar

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions