From 582189336d0cae1efb80386950553757c785bbfd Mon Sep 17 00:00:00 2001 From: Baptiste <32563450+BapRx@users.noreply.github.com> Date: Tue, 10 Jan 2023 23:46:33 +0100 Subject: [PATCH] chore(#621): Exit atuin when pressing down arrow on most recent entry (#659) Signed-off-by: Baptiste Roux Signed-off-by: Baptiste Roux --- src/command/client/search/interactive.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/command/client/search/interactive.rs b/src/command/client/search/interactive.rs index fc22d28..e0ceb09 100644 --- a/src/command/client/search/interactive.rs +++ b/src/command/client/search/interactive.rs @@ -122,6 +122,9 @@ impl State { } TermEvent::Key(Key::Down | Key::Ctrl('n' | 'j')) | TermEvent::Mouse(MouseEvent::Press(MouseButton::WheelDown, _, _)) => { + if self.results_state.selected() == 0 && input.eq(&TermEvent::Key(Key::Down)) { + return Some(RETURN_ORIGINAL); + } let i = self.results_state.selected().saturating_sub(1); self.results_state.select(i); }