Skip to content

Commit a5b898c

Browse files
committed
fix potential panic
1 parent 9e69f25 commit a5b898c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ui/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub const fn calc_scroll_top(
2222
height_in_lines: usize,
2323
selection: usize,
2424
) -> usize {
25-
if current_top + height_in_lines <= selection {
25+
if current_top.saturating_add(height_in_lines) <= selection {
2626
selection.saturating_sub(height_in_lines) + 1
2727
} else if current_top > selection {
2828
selection

0 commit comments

Comments
 (0)