mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-25 06:24:26 +00:00
undo changes proposed by adam in scroll up and down funcs
This commit is contained in:
parent
c12097de08
commit
544cbd4035
|
@ -512,6 +512,9 @@ impl AppState {
|
||||||
|
|
||||||
fn scroll_down(&mut self) {
|
fn scroll_down(&mut self) {
|
||||||
let len = self.filter.item_list().len();
|
let len = self.filter.item_list().len();
|
||||||
|
if len == 0 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let current = self.selection.selected().unwrap_or(0);
|
let current = self.selection.selected().unwrap_or(0);
|
||||||
let max_index = if self.at_root() { len - 1 } else { len };
|
let max_index = if self.at_root() { len - 1 } else { len };
|
||||||
let next = if current + 1 > max_index {
|
let next = if current + 1 > max_index {
|
||||||
|
@ -525,6 +528,9 @@ impl AppState {
|
||||||
|
|
||||||
fn scroll_up(&mut self) {
|
fn scroll_up(&mut self) {
|
||||||
let len = self.filter.item_list().len();
|
let len = self.filter.item_list().len();
|
||||||
|
if len == 0 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let current = self.selection.selected().unwrap_or(0);
|
let current = self.selection.selected().unwrap_or(0);
|
||||||
let max_index = if self.at_root() { len - 1 } else { len };
|
let max_index = if self.at_root() { len - 1 } else { len };
|
||||||
let next = if current == 0 { max_index } else { current - 1 };
|
let next = if current == 0 { max_index } else { current - 1 };
|
||||||
|
|
Loading…
Reference in New Issue
Block a user