mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
fix potential panic
This commit is contained in:
parent
9e69f251a8
commit
a5b898c718
1 changed files with 1 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ pub const fn calc_scroll_top(
|
|||
height_in_lines: usize,
|
||||
selection: usize,
|
||||
) -> usize {
|
||||
if current_top + height_in_lines <= selection {
|
||||
if current_top.saturating_add(height_in_lines) <= selection {
|
||||
selection.saturating_sub(height_in_lines) + 1
|
||||
} else if current_top > selection {
|
||||
selection
|
||||
|
|
|
|||
Loading…
Reference in a new issue