Skip to content

Attempt to subtract with overflow when output exceeds terminal height #582

@smoelius

Description

@smoelius

I am observing attempt to subtract with overflow on this line:

*last_line_count = real_len - self.orphan_lines_count + shift;

self.lines.len() >= self.orphan_lines_count holds prior to entering this loop:

for (idx, line) in self.lines.iter().enumerate() {

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:

if real_len + diff > term_height {
break;
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions