AMythicDev/minus

Pager panics when static output has > `u16::get_max()` lines

Closed this issue · 3 comments

Describe the bug
When the static output has more lines than u16::get_max() and the user attempts to move to a line whose number is larger than u16::get_max(), the pager panics. This is because of the unwrap on line 106 of search.rs.

To Reproduce
Statically page output with more than u16::get_max() (65535) lines of output, then jump to the bottom with G

Expected behavior
The pager should not crash.

Desktop:
macOS Big Sur, iTerm2, rustc 1.55 stable, minus version 4.0.1.

I have a fix ready to go that doesn't crash and passes all tests when running cargo test --release --all-features. If you'd like this to be fixed, I'd love to submit a PR with the fix.

I am interested in looking into the PR. Thanks for reporting the bug

Just opened #51, which should fix this.

Merged into main branch