Up arrow filter_mode setting default to global filter mode (#758)

Resolves #756
This commit is contained in:
Ellie Huxtable 2023-03-05 18:43:03 +00:00 committed by GitHub
parent 24388033a5
commit 3eb50a8383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -110,7 +110,7 @@ pub struct Settings {
pub session_path: String,
pub search_mode: SearchMode,
pub filter_mode: FilterMode,
pub filter_mode_shell_up_key_binding: FilterMode,
pub filter_mode_shell_up_key_binding: Option<FilterMode>,
pub shell_up_key_binding: bool,
pub show_preview: bool,
pub exit_mode: ExitMode,
@ -295,7 +295,6 @@ impl Settings {
.set_default("sync_address", "https://api.atuin.sh")?
.set_default("search_mode", "fuzzy")?
.set_default("filter_mode", "global")?
.set_default("filter_mode_shell_up_key_binding", "global")?
.set_default("shell_up_key_binding", false)?
.set_default("show_preview", false)?
.set_default("exit_mode", "return-original")?

View file

@ -88,7 +88,9 @@ impl Cmd {
if self.filter_mode.is_some() {
settings.filter_mode = self.filter_mode.unwrap();
}
settings.shell_up_key_binding = self.shell_up_key_binding;
if self.interactive {
let item = interactive::history(&self.query, settings, db).await?;
eprintln!("{item}");

View file

@ -427,7 +427,9 @@ pub async fn history(
results_state: ListState::default(),
context: current_context(),
filter_mode: if settings.shell_up_key_binding {
settings.filter_mode_shell_up_key_binding
settings
.filter_mode_shell_up_key_binding
.unwrap_or(settings.filter_mode)
} else {
settings.filter_mode
},