From 936e46becc0ba237279b3349ee5768deeaabc03c Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Tue, 30 Jul 2024 17:07:19 -0500 Subject: [PATCH] fix enter key running on preview --- src/list.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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, } }