From e3c91115a2c096724303a0b364e7625691e4beba Mon Sep 17 00:00:00 2001 From: aidancz <97080720+aidancz@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:15:20 +0800 Subject: [PATCH] fix: wrong file list offset squeeze when `scrolloff = 0` (#1866) --- yazi-fs/src/folder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yazi-fs/src/folder.rs b/yazi-fs/src/folder.rs index ac1d4aa0b..c0f0dfe71 100644 --- a/yazi-fs/src/folder.rs +++ b/yazi-fs/src/folder.rs @@ -149,7 +149,7 @@ impl Folder { self.offset = if self.cursor < (self.offset + limit).min(len).saturating_sub(scrolloff) { len.saturating_sub(limit).min(self.offset) } else { - len.saturating_sub(limit).min(self.cursor.saturating_sub(limit) + scrolloff) + len.saturating_sub(limit).min(self.cursor.saturating_sub(limit) + 1 + scrolloff) }; old != self.offset