Skip to content

Commit

Permalink
Fix potential overflow panic
Browse files Browse the repository at this point in the history
  • Loading branch information
YS-L committed Oct 21, 2023
1 parent 7ae1de2 commit 6bc0b87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ impl RowsView {
match control {
Control::ScrollDown => {
if let Some(i) = self.selection.row.index() {
if i >= self.num_rows_rendered - 1 {
if i >= self.num_rows_rendered.saturating_sub(1) {
self.increase_rows_from(1)?;
} else {
self.selection.row.select_next();
Expand Down

0 comments on commit 6bc0b87

Please sign in to comment.