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

fix: error that caused usize to overflow #3024

Merged
merged 2 commits into from
Jul 10, 2022

Conversation

GreasySlug
Copy link
Contributor

fix this bug #2981

@GreasySlug
Copy link
Contributor Author

GreasySlug commented Jul 10, 2022

Thank you for reviewing😊

@archseer archseer merged commit e109022 into helix-editor:master Jul 10, 2022
@@ -1414,7 +1414,7 @@ fn copy_selection_on_line(cx: &mut Context, direction: Direction) {
let (head, anchor) = if range.anchor < range.head {
(range.head - 1, range.anchor)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this here too?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's possible for range.head to be 0 in this branch because of the if condition: range.anchor < range.head implies range.head is >= 1 unless it's a zero-width selection which should not be possible

# 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.

4 participants