Do not move past number of matches
This commit is contained in:
parent
5463a436a8
commit
2ac496f919
1 changed files with 5 additions and 2 deletions
|
@ -100,8 +100,11 @@ impl<T> Picker<T> {
|
|||
}
|
||||
|
||||
pub fn move_down(&mut self) {
|
||||
// TODO: len - 1
|
||||
if self.cursor < self.options.len() {
|
||||
if self.matches.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
if self.cursor < self.matches.len() - 1 {
|
||||
self.cursor += 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue