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

subtract with overflow in new line iterator #76

Closed
bjorn-ove opened this issue Jan 31, 2023 · 4 comments · Fixed by #77
Closed

subtract with overflow in new line iterator #76

bjorn-ove opened this issue Jan 31, 2023 · 4 comments · Fixed by #77

Comments

@bjorn-ove
Copy link

It appears there is an issue that was introduced by #70.

The issue is an subtract with overflow in

ropey/src/iter.rs

Line 1240 in 1029afa

self.total_lines - self.line_idx,

The following code reproduces the issue.

use ropey::Rope;

fn main() {
    dbg!(Rope::from_str("").lines_at(0).collect::<Vec<_>>());
}
@cessen
Copy link
Owner

cessen commented Jan 31, 2023

Thanks so much for catching and reporting this! A fix is on its way.

@cessen
Copy link
Owner

cessen commented Jan 31, 2023

I'll make a release with the fix later today.

@bjorn-ove
Copy link
Author

Thank you for very quick response. This was above and beyond expectations 👍

@cessen
Copy link
Owner

cessen commented Feb 1, 2023

No problem! Also, just published v1.6.0 with the bug fix.

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 a pull request may close this issue.

2 participants