only trim persistent state files if persistent state is enabled

pull/9143/head
Ingrid 2 months ago
parent be1deec1ed
commit 554f0f891d

@ -290,30 +290,36 @@ impl Application {
.context("build signal handler")?;
let jobs = Jobs::new();
let file_trim = config.load().editor.persistence.old_files_trim;
jobs.add(
Job::new(async move {
persistence::trim_file_history(file_trim);
Ok(())
})
.wait_before_exiting(),
);
let commands_trim = config.load().editor.persistence.commands_trim;
jobs.add(
Job::new(async move {
persistence::trim_command_history(commands_trim);
Ok(())
})
.wait_before_exiting(),
);
let search_trim = config.load().editor.persistence.search_trim;
jobs.add(
Job::new(async move {
persistence::trim_search_history(search_trim);
Ok(())
})
.wait_before_exiting(),
);
if config.load().editor.persistence.old_files {
let file_trim = config.load().editor.persistence.old_files_trim;
jobs.add(
Job::new(async move {
persistence::trim_file_history(file_trim);
Ok(())
})
.wait_before_exiting(),
);
}
if config.load().editor.persistence.commands {
let commands_trim = config.load().editor.persistence.commands_trim;
jobs.add(
Job::new(async move {
persistence::trim_command_history(commands_trim);
Ok(())
})
.wait_before_exiting(),
);
}
if config.load().editor.persistence.search {
let search_trim = config.load().editor.persistence.search_trim;
jobs.add(
Job::new(async move {
persistence::trim_search_history(search_trim);
Ok(())
})
.wait_before_exiting(),
);
}
let app = Self {
compositor,

Loading…
Cancel
Save