mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-09 16:00:35 +00:00
Fix bug in selection navigation
This commit is contained in:
parent
b875a37ded
commit
45d15bf03a
10
src/view.rs
10
src/view.rs
@ -39,8 +39,10 @@ impl<'a> View<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn next(&mut self) {
|
pub fn next(&mut self, maximum: usize) {
|
||||||
self.skip = self.skip + 1;
|
if self.skip < maximum {
|
||||||
|
self.skip = self.skip + 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn present(&mut self) -> Option<(String, bool)> {
|
pub fn present(&mut self) -> Option<(String, bool)> {
|
||||||
@ -114,9 +116,9 @@ impl<'a> View<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Key::Up => { self.prev(); }
|
Key::Up => { self.prev(); }
|
||||||
Key::Down => { self.next(); }
|
Key::Down => { self.next(matches.len() - 1); }
|
||||||
Key::Left => { self.prev(); }
|
Key::Left => { self.prev(); }
|
||||||
Key::Right => { self.next(); }
|
Key::Right => { self.next(matches.len() - 1); }
|
||||||
Key::Char(ch) => {
|
Key::Char(ch) => {
|
||||||
let key = ch.to_string();
|
let key = ch.to_string();
|
||||||
let lower_key = key.to_lowercase();
|
let lower_key = key.to_lowercase();
|
||||||
|
Loading…
Reference in New Issue
Block a user