-
Notifications
You must be signed in to change notification settings - Fork 245
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
Attempt to subtract with overflow when output exceeds terminal height #582
Comments
Here are steps to reproduce the bug.
#[test]
fn many_lines() {
let mut s = String::new();
for _ in 0..100 {
s.push('\n');
}
None::<()>.expect(&s);
}
You should see something like this:
|
@smoelius thanks for the detailed issue and reproduction case. Unfortunately I don't have much time to dig into this in detail at the moment. The code you're referencing here was introduced in #563, maybe read up on that to figure out if/why the branch was necessary? Probably the easiest fix is to just slap a |
Thank you very much for providing the background. I will try to look into this more and propose a fix. |
I am observing
attempt to subtract with overflow
on this line:indicatif/src/draw_target.rs
Line 534 in 40b40d2
self.lines.len() >= self.orphan_lines_count
holds prior to entering this loop:indicatif/src/draw_target.rs
Line 501 in 40b40d2
And
real_len >= idx
holds at the start of each iteration of that loop.Those two facts causes me to squint at this
if
block:indicatif/src/draw_target.rs
Lines 517 to 519 in 40b40d2
In particular, commenting out that
if
block causes my panics to go away.I don't completely understand the purpose of that
if
block, but maybe it can go away?(indicatif is a great tool, BTW.)
The text was updated successfully, but these errors were encountered: