Do not move past number of matches

imgbot
Kevin Sjöberg 3 years ago committed by Blaž Hrastnik
parent 5463a436a8
commit 2ac496f919

@ -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…
Cancel
Save