-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Mac word modifier TextEditingActions #78573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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