Do not move past number of matches

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

@ -100,8 +100,11 @@ impl<T> Picker<T> {
} }
pub fn move_down(&mut self) { pub fn move_down(&mut self) {
// TODO: len - 1 if self.matches.is_empty() {
if self.cursor < self.options.len() { return;
}
if self.cursor < self.matches.len() - 1 {
self.cursor += 1; self.cursor += 1;
} }
} }

Loading…
Cancel
Save