on master help sign in
Do not move past number of matches
2ac496fKevin Sjöberg
helix-term/src/ui/picker.rs+5−2
@@ -100,8 +100,11 @@ impl<T> Picker<T> {
100 }
100 }
101
101
102 pub fn move_down(&mut self) {
102 pub fn move_down(&mut self) {
103− // TODO: len - 1
103+ if self.matches.is_empty() {
104+ return;
105+ }
106+
104− if self.cursor < self.options.len() {
107+ if self.cursor < self.matches.len() - 1 {
105 self.cursor += 1;
108 self.cursor += 1;
106 }
109 }
107 }
110 }