Skip to content

Implement word and line selection modes with corresponding methods and tests#6465

Open
JakeGinnivan wants to merge 1 commit intoTextualize:mainfrom
JakeGinnivan:feat/standard-selection-behaviours
Open

Implement word and line selection modes with corresponding methods and tests#6465
JakeGinnivan wants to merge 1 commit intoTextualize:mainfrom
JakeGinnivan:feat/standard-selection-behaviours

Conversation

@JakeGinnivan
Copy link
Copy Markdown

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant