diff --git a/src/list.rs b/src/list.rs index 0f7b9bdd..522585ba 100644 --- a/src/list.rs +++ b/src/list.rs @@ -272,7 +272,14 @@ impl CustomList { self.toggle_preview_window(state); None } - KeyCode::Enter => self.handle_enter(), + + KeyCode::Enter => { + if self.preview_window_state.is_none() { + self.handle_enter() + } else { + None + } + } _ => None, } }