Implement word and line selection modes with corresponding methods and tests#6465
Open
JakeGinnivan wants to merge 1 commit intoTextualize:mainfrom
Open
Implement word and line selection modes with corresponding methods and tests#6465JakeGinnivan wants to merge 1 commit intoTextualize:mainfrom
JakeGinnivan wants to merge 1 commit intoTextualize:mainfrom
Conversation
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.
I only just realised each PR needs an issue or discussion.
I could not find one relating to this, and I've implemented the feature already so I figured we could just have the discussion on this PR @willmcgugan and if it doesn't align then all good I can close. Or I can create the issue/discussion, just let me know.
Problem
Text selection works in a pretty standard way across most operating systems. Double click selects a word, triple click selects a visual line. Double click and hold (or click and a half) then dragging selects a word at a time, rather than by character, and triple click and hold (or double click and a half) then dragging selects visual line at a time.
This PR introduces a new selection mode (Standard) which implements this. Legacy remains the default.
This PR also allows you to opt out of the selection behaviour, because I implemented most of the above by overriding things, but was constantly fighting the inbuilt selection behaviours. Might not need the opt out, but could be handy for someone who wants to do something different.
I've consumed this downstream and selection feels natural again :)