Fix cursor moving to next line instead of end of line#87133
Merged
fluttergithubbot merged 2 commits intoflutter:masterfrom Jul 29, 2021
Merged
Fix cursor moving to next line instead of end of line#87133fluttergithubbot merged 2 commits intoflutter:masterfrom
fluttergithubbot merged 2 commits intoflutter:masterfrom
Conversation
Contributor
Renzo-Olivares
left a comment
There was a problem hiding this comment.
Can this be tested? Maybe by checking the cursor position before/after executing the shortcut (if that's possible).
LGTM other than that
Contributor
Author
|
@Renzo-Olivares The changes I made in the test files do just that. The existing tests executed the shortcut and then checked the position just using base/extentOffset, but that wasn't enough, they also needed to check affinity, which is what I added. |
Renzo-Olivares
approved these changes
Jul 27, 2021
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously, when doing cmd + right arrow, the cursor incorrectly went to the start of the next line instead of the end of the current line due to a TextAffinity problem.
Say the selection is somewhere in a line:
The user then hits cmd-right, which should move the cursor to the end of the current line, but currently the affinity gets lost and it goes to the next line:
After this PR, it correctly goes to the end of the line:
This PR also explicitly sets the affinity in the left direction, even though it's the same as the default.