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

Fix shrink_selection with multiple cursors. #6093

Merged
merged 2 commits into from
Mar 9, 2023

Conversation

gibbz00
Copy link
Contributor

@gibbz00 gibbz00 commented Feb 23, 2023

Fixes #6092

Caused by some incorrect assumptions that missed an edge case in the Selection.contains() calculation. Tests were added accordingly.

asciicast

Cause were some incorrect assumptions that missed an edge case in the
`Selection.contains()` calculation. Tests were added accordingly.
helix-term/src/commands.rs Show resolved Hide resolved
helix-core/src/selection.rs Show resolved Hide resolved
helix-core/src/selection.rs Outdated Show resolved Hide resolved
Removing the len check short-circuit was the only thing needed as
pointed out by @dead10ck.
Copy link
Member

@dead10ck dead10ck left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks!

@archseer archseer merged commit 2cf4ce2 into helix-editor:master Mar 9, 2023
sagnibak pushed a commit to sagnibak/helix that referenced this pull request Mar 21, 2023
* Fix helix-editor#6092

Cause were some incorrect assumptions that missed an edge case in the
`Selection.contains()` calculation. Tests were added accordingly.

* Fix Selection.contains() edge-case handling.

Removing the len check short-circuit was the only thing needed as
pointed out by @dead10ck.
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
* Fix helix-editor#6092

Cause were some incorrect assumptions that missed an edge case in the
`Selection.contains()` calculation. Tests were added accordingly.

* Fix Selection.contains() edge-case handling.

Removing the len check short-circuit was the only thing needed as
pointed out by @dead10ck.
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.

shrink_selection does not properly restore cursor with multiple selections.
3 participants