cessen / ropey

A utf8 text rope for manipulating and editing large texts.
MIT License
1.04k stars 46 forks source link

subtract with overflow in new line iterator #76

Closed bjorn-ove closed 1 year ago

bjorn-ove commented 1 year ago

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

The issue is an subtract with overflow in https://github.com/cessen/ropey/blob/1029afac9ff0878cb5a68152745fa855dd996d62/src/iter.rs#L1240

The following code reproduces the issue.

use ropey::Rope;

fn main() {
    dbg!(Rope::from_str("").lines_at(0).collect::<Vec<_>>());
}
cessen commented 1 year ago

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

cessen commented 1 year ago

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

bjorn-ove commented 1 year ago

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

cessen commented 1 year ago

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