From 03f7e5543eac4dfac10cc282f709dfaeaef2bf4b Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Sat, 25 Mar 2023 17:06:10 +0100 Subject: [PATCH] Respect exit_mode setting when exiting with arrow down keypress (#807) --- src/command/client/search/interactive.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/command/client/search/interactive.rs b/src/command/client/search/interactive.rs index 4b5e0d7..feec417 100644 --- a/src/command/client/search/interactive.rs +++ b/src/command/client/search/interactive.rs @@ -231,7 +231,12 @@ impl State { self.search.switched_search_mode = true; self.search.search_mode = self.search.search_mode.next(settings); } - KeyCode::Down if self.results_state.selected() == 0 => return Some(RETURN_ORIGINAL), + KeyCode::Down if self.results_state.selected() == 0 => { + return Some(match settings.exit_mode { + ExitMode::ReturnOriginal => RETURN_ORIGINAL, + ExitMode::ReturnQuery => RETURN_QUERY, + }) + } KeyCode::Down => { let i = self.results_state.selected().saturating_sub(1); self.results_state.select(i);