Repository: sxyazi/yazi (language: rust)

Issue:
Wrong file list offset squeeze when `scrolloff = 0`
### What system are you running Yazi on?

Linux X11

### What terminal are you running Yazi in?

st 0.8.5

### `yazi --debug` output

```Shell
Yazi
    Version: 0.3.3 (c668723 2024-10-30)
    Debug  : true
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.3 (Arch Linux 2024-09-05)

Emulator
    Emulator.via_env: ("st-256color", "")
    Emulator.via_csi: Ok(Unknown([]))
    Emulator.detect : Unknown([])

Adapter
    Adapter.matches: X11

Desktop
    XDG_SESSION_TYPE           : Some("tty")
    WAYLAND_DISPLAY            : None
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/usr/bin/zsh")
    EDITOR             : Some("nvim")
    VISUAL             : Some("nvim")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default     : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : tmux 3.5a
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file             : 5.45
    ueberzugpp       : 2.9.6
    ffmpegthumbnailer: 2.2.3
    magick           : 7.1.1-39
    fzf              : 0.55.0
    fd               : 10.2.0
    rg               : 14.1.1
    chafa            : 1.14.2
    zoxide           : 0.9.6
    7z               : 17.05
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1


--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/home/aidan/.local/state/yazi" directory.
```


### Describe the bug

when set `scrolloff = 0`
current hovered file is invisible


https://github.com/user-attachments/assets/4b0a8ca4-afa9-4471-ac2f-d22adb676184



### Minimal reproducer

yazi.toml:

```
[manager]
scrolloff = 0
```

and open yazi anywhere

### Anything else?

_No response_

### Validations

- [X] I tried the [latest nightly build](https://yazi-rs.github.io/docs/installation#official-binaries), and the issue is still reproducible
- [X] I updated the debug information (`yazi --debug`) input box to the nightly that I tried
- [X] I can reproduce it after disabling all custom configs/plugins (`mv ~/.config/yazi ~/.config/yazi-backup`)


Discussion / hints:
Thanks for reporting, I can confirm this bug. 

Would you like to send a PR to fix it? The code can be found at:

https://github.com/sxyazi/yazi/blob/a8bd21ad5fadce0a9c718fb25609e1e34f2e3d06/yazi-fs/src/folder.rs#L142-L156

Fix patch:
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


Test patch: