mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix edge case
This commit is contained in:
parent
fa9e17306c
commit
7fa9c4da72
1 changed files with 1 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue