@@ -270,12 +270,18 @@ impl<T> Picker<T> {
272 pub fn move_up(&mut self) {
272 pub fn move_up(&mut self) {
273+ if self.matches.is_empty() {
273 let len = self.matches.len();
276 let len = self.matches.len();
274 let pos = ((self.cursor + len.saturating_sub(1)) % len) % len;
277 let pos = ((self.cursor + len.saturating_sub(1)) % len) % len;
275 self.cursor = pos;
278 self.cursor = pos;
278 pub fn move_down(&mut self) {
281 pub fn move_down(&mut self) {
282+ if self.matches.is_empty() {
279 let len = self.matches.len();
285 let len = self.matches.len();
280 let pos = (self.cursor + 1) % len;
286 let pos = (self.cursor + 1) % len;
281 self.cursor = pos;
287 self.cursor = pos;