mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
0b98859488
commit
c388f6f2c2
2 changed files with 6 additions and 6 deletions
|
|
@ -50,9 +50,9 @@ impl Help {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn arrow(&mut self, step: isize) -> bool {
|
pub fn arrow(&mut self, step: isize) -> bool {
|
||||||
let len = self.bindings.len();
|
let max = self.bindings.len().saturating_sub(1);
|
||||||
self.offset = self.offset.min(len);
|
self.offset = self.offset.min(max);
|
||||||
self.cursor = self.cursor.min(len.saturating_sub(1));
|
self.cursor = self.cursor.min(max);
|
||||||
|
|
||||||
if step > 0 { self.next(step as usize) } else { self.prev(step.unsigned_abs()) }
|
if step > 0 { self.next(step as usize) } else { self.prev(step.unsigned_abs()) }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,9 @@ impl Folder {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let len = self.files.len();
|
let max = self.files.len().saturating_sub(1);
|
||||||
self.offset = self.offset.min(len);
|
self.offset = self.offset.min(max);
|
||||||
self.cursor = self.cursor.min(len.saturating_sub(1));
|
self.cursor = self.cursor.min(max);
|
||||||
self.set_page(true);
|
self.set_page(true);
|
||||||
|
|
||||||
self.hover_repos();
|
self.hover_repos();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue