-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Make mouse click extend selection in select mode #5436
Make mouse click extend selection in select mode #5436
Conversation
f18db9d
to
f6617c1
Compare
Conflicts with #5420. Rebased. |
Regarding the |
f6617c1
to
1c0a794
Compare
1c0a794
to
277de2b
Compare
277de2b
to
4c4a98f
Compare
4c4a98f
to
cfef31b
Compare
cfef31b
to
577cf91
Compare
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.
Sorry for the delay - I've been meaning to look at this for a while. The change itself looks good and the behavior feels right. I just have one small nit
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.
Thanks!
* Make mouse click extend selection in select mode * chore: better readability with `Option::take()`
* Make mouse click extend selection in select mode * chore: better readability with `Option::take()`
* Make mouse click extend selection in select mode * chore: better readability with `Option::take()`
* Make mouse click extend selection in select mode * chore: better readability with `Option::take()`
* Make mouse click extend selection in select mode * chore: better readability with `Option::take()`
* Make mouse click extend selection in select mode * chore: better readability with `Option::take()`
Resolves #5425. Design rationale detailed in #5425 comments.
I'm not entirely sure whether this change is desired, but am still submitting this optimistically as I think it makes a lot of sense. I use Helix on a touch screen device (phone) sometimes and find this extremely useful for selecting code blocks as touches are easier to do than key strokes on such devices. It annoys me that currently the only way to extend a selection would be to use a keyboard.
This PR should improve the mouse UX. It's now possible to extend the primary selection with mouse clicks. The original drag-to-yank behavior is also retained.
With this PR, the editor no longer collapses all selections into a single point on mouse clicks unconditionally. Instead, it extends the primary selection to the point click when it's in select mode (secondary selections are still discarded for consistency). Normal mode behavior is left untouched.