Respect exit_mode setting when exiting with arrow down keypress (#807)

This commit is contained in:
Patrick Decat 2023-03-25 17:06:10 +01:00 committed by GitHub
parent 3b77e1130c
commit 03f7e5543e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,7 +231,12 @@ impl State {
self.search.switched_search_mode = true; self.search.switched_search_mode = true;
self.search.search_mode = self.search.search_mode.next(settings); 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 => { KeyCode::Down => {
let i = self.results_state.selected().saturating_sub(1); let i = self.results_state.selected().saturating_sub(1);
self.results_state.select(i); self.results_state.select(i);