Skip to content

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