diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 4cff4917..c3592062 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -100,8 +100,11 @@ impl Picker { } 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; } }