Skip to content
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

Support extend for multiple goto #909

Merged
merged 1 commit into from
Oct 29, 2021
Merged

Conversation

pickfire
Copy link
Contributor

gg, ge, [n]gg

Copy link
Member

@archseer archseer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using selection(..).clone().transform() seems a bit wasteful because you're modifying all the ranges to extend to the same place. This will probably end up merging ranges which is not what you intended to do.

I think you should simply take the primary range, modify it with put cursor, then call
set_selection(view.id, Selection::single(new_range))

@pickfire
Copy link
Contributor Author

Using selection(..).clone().transform() seems a bit wasteful because you're modifying all the ranges to extend to the same place. This will probably end up merging ranges which is not what you intended to do.

I believe that is the intended one when you have multiple cursors. With the largest range overlapping to the place you want it to be. Otherwise it might be a bit surprising that some of the cursors did not move.

@archseer
Copy link
Member

Yeah okay, was able to reproduce in kakoune: https://asciinema.org/a/nH0vbF5TKlNIbgv4vWNY1VRJM

@archseer archseer merged commit 21d5355 into helix-editor:master Oct 29, 2021
@pickfire pickfire deleted the goto-extend branch October 29, 2021 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants