Add support for by word movement granularities to semantics#19949
Merged
jonahwilliams merged 13 commits intoflutter:masterfrom Aug 17, 2018
Merged
Add support for by word movement granularities to semantics#19949jonahwilliams merged 13 commits intoflutter:masterfrom
jonahwilliams merged 13 commits intoflutter:masterfrom
Conversation
…movement_granulairities
Contributor
Author
|
Analyze died quickly for some reason so macos tests didn't run, should pass and will rerun when it is done. |
…movement_granulairities
goderbauer
approved these changes
Aug 14, 2018
| return; | ||
| final int baseOffset = !extentSelection ? nextWord.start : _selection.baseOffset; | ||
| onSelectionChanged( | ||
| new TextSelection(baseOffset: baseOffset, extentOffset: nextWord.start), this, SelectionChangedCause.keyboard); |
Member
There was a problem hiding this comment.
nit: maybe put each argument on a separate line?
| final TextRange nextWord = _getNextWord(currentWord.end); | ||
| if (nextWord == null) | ||
| return; | ||
| final int baseOffset = !extentSelection ? nextWord.start : _selection.baseOffset; |
Member
There was a problem hiding this comment.
This might be easier to comprehend if you switch it around and remove the negation?
| if (!_onlyWhitespace(range)) | ||
| return range; | ||
| offset = range.start - 1; | ||
| } |
Member
There was a problem hiding this comment.
is this missing a return statement if offset drops below 0?
| for (int i = range.start; i < range.end; i++) { | ||
| final int codeUnit = text.codeUnitAt(i); | ||
| switch (codeUnit) { | ||
| case 0x9: // horizontal tab |
Member
There was a problem hiding this comment.
Could you link to where this list is coming from in case we need to update it?
…movement_granulairities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the movement granularity support by text to byWord. To mimic the Android implementation, we skip words which only contain whitespace and unicode separator values.
Fixes #13389
Work towards #13406