mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 12:54:59 +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) {
|
||||
self.skip = self.skip + 1;
|
||||
pub fn next(&mut self, maximum: usize) {
|
||||
if self.skip < maximum {
|
||||
self.skip = self.skip + 1;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn present(&mut self) -> Option<(String, bool)> {
|
||||
@ -114,9 +116,9 @@ impl<'a> View<'a> {
|
||||
}
|
||||
}
|
||||
Key::Up => { self.prev(); }
|
||||
Key::Down => { self.next(); }
|
||||
Key::Down => { self.next(matches.len() - 1); }
|
||||
Key::Left => { self.prev(); }
|
||||
Key::Right => { self.next(); }
|
||||
Key::Right => { self.next(matches.len() - 1); }
|
||||
Key::Char(ch) => {
|
||||
let key = ch.to_string();
|
||||
let lower_key = key.to_lowercase();
|
||||
|
Loading…
Reference in New Issue
Block a user