mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 21:05:00 +00:00
Fix bug in selection navigation
This commit is contained in:
parent
b875a37ded
commit
45d15bf03a
@ -39,9 +39,11 @@ impl<'a> View<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn next(&mut self) {
|
||||
pub fn next(&mut self, maximum: usize) {
|
||||
if self.skip < maximum {
|
||||
self.skip = self.skip + 1;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn present(&mut self) -> Option<(String, bool)> {
|
||||
let mut rustbox = match RustBox::init(Default::default()) {
|
||||
@ -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