Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a check to prevent re-selecting same range #2760

Merged
merged 2 commits into from
Jun 14, 2022

Conversation

sohnryang
Copy link
Contributor

This fixes #2714.

@the-mikedavis
Copy link
Member

I gave this a try and it looks like there's an edge-case when we expand to the root node: we hit A-o until we are at the root node and then A-i doesn't change the selection.

Instead, I think we can compare the selection returned by the object::expand_selection line and current_selection. We should only push current_selection and call doc.set_selection if the current_selection isn't equal to the expanded selection

@sohnryang
Copy link
Contributor Author

Fixed!

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

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

Works great, thanks for the fix!

@the-mikedavis the-mikedavis merged commit 3bd5545 into helix-editor:master Jun 14, 2022
lazytanuki pushed a commit to lazytanuki/helix that referenced this pull request Jun 21, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hitting A-o stacks up "deselects" even though there is nothing more to select.
2 participants