Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, in `foo b|ar` where `|` indicates the cursor position, `Cursor::previous_logical_word` will return `foo| bar`. This doesn't match the behavior of `Cursor::{next_logical_word, previous_visual_word}` which place the cursor at the boundary of the current word. This happens because `Cluster::previous_logical_word` is called from the upstream cluster (the "b") and the cursor then lands between the "o" and the space. This also renames "left", "right" -> "upstream", "downstream" (naming copied from `Cursor::logical_clusters`) to make it clear we're operating in logical order and not visual, and sets `moving_right` based on the text direction we're jumping to, to affine the cursor towards the word whose boundary it lands on. (Note the behavior between `{previous, next}_logical_word` and {previous, next}_visual_word` aren't quite the same yet: the `visual` methods jump over whitespace, the `logical` ones don't.)
- Loading branch information