aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/ui/picker.rs7
1 files changed, 5 insertions, 2 deletions
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<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;
}
}