Mac word modifier TextEditingActions#78573
Conversation
| // | ||
| // See extendSelectionLeftByWord for a detailed explanation of the two | ||
| // optional parameters. | ||
| static TextSelection _extendGivenSelectionLeftByWord(TextPainter textPainter, TextSelection selection, [bool includeWhitespace = true, bool stopAtReversal = false]) { |
There was a problem hiding this comment.
Looking at the implementation of _getLeftByWord, I think we may want to change the name to extendGivenSelectionUpstreamByWord or something, as the current implementation moves the extentOffset backwards in the text's logical direction.
| const ExtendSelectionLeftByLineTextIntent(); | ||
| } | ||
|
|
||
| /// An [Intent] to extend the selection left past the nearest word, collapsing |
There was a problem hiding this comment.
Looks like the method extends the selection towards the start of the text, instead of moving left. Does that match macOS's behavior?
There was a problem hiding this comment.
in Pages in RTL text pressing <- the cursor moves towards the end of the text.
|
We talked offline about the arrow key direction. The conclusion is that we will fix it in another PR and keep the naming the same for now. Issue: #78660 It seems that this direction bug existed before I started refactoring text editing shortcuts (tested at 57dc5f2). |
Before this PR, Mac had some incorrect behavior when navigating through text with word modifier keys, as noted in this table: #57679 (comment)
For "word wo|rd| word" selected left to right...
On Mac, pressing word modifier + shift + left should now correctly result in "word wo|rd word". Other platforms result in "word |word| word".
And vice versa for the right arrow and a right to left selection.
Closes #57679
A similar problem in Windows not fixed by this: #78572