From 7fa9c4da7283478f4b4a15823ba361f6e9049498 Mon Sep 17 00:00:00 2001 From: Xerxes-2 Date: Wed, 26 Jun 2024 20:20:49 +1000 Subject: [PATCH] fix edge case --- yazi-core/src/input/commands/move_.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yazi-core/src/input/commands/move_.rs b/yazi-core/src/input/commands/move_.rs index 6a261951..557f17eb 100644 --- a/yazi-core/src/input/commands/move_.rs +++ b/yazi-core/src/input/commands/move_.rs @@ -41,7 +41,7 @@ impl Input { let (limit, snap) = (self.limit(), self.snap_mut()); let half_limit = limit / 2; let max_offset = snap.cursor.saturating_sub(half_limit); - let min_offset = max_offset.min(snap.len().saturating_sub(limit)); + let min_offset = max_offset.min(snap.len().saturating_sub(limit - 1)); if snap.offset > max_offset { snap.offset = max_offset; } else if snap.offset < min_offset {