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")?; .context("build signal handler")?;
let jobs = Jobs::new(); let jobs = Jobs::new();
let file_trim = config.load().editor.persistence.old_files_trim; if config.load().editor.persistence.old_files {
jobs.add( let file_trim = config.load().editor.persistence.old_files_trim;
Job::new(async move { jobs.add(
persistence::trim_file_history(file_trim); Job::new(async move {
Ok(()) persistence::trim_file_history(file_trim);
}) Ok(())
.wait_before_exiting(), })
); .wait_before_exiting(),
let commands_trim = config.load().editor.persistence.commands_trim; );
jobs.add( }
Job::new(async move { if config.load().editor.persistence.commands {
persistence::trim_command_history(commands_trim); let commands_trim = config.load().editor.persistence.commands_trim;
Ok(()) jobs.add(
}) Job::new(async move {
.wait_before_exiting(), persistence::trim_command_history(commands_trim);
); Ok(())
let search_trim = config.load().editor.persistence.search_trim; })
jobs.add( .wait_before_exiting(),
Job::new(async move { );
persistence::trim_search_history(search_trim); }
Ok(()) if config.load().editor.persistence.search {
}) let search_trim = config.load().editor.persistence.search_trim;
.wait_before_exiting(), jobs.add(
); Job::new(async move {
persistence::trim_search_history(search_trim);
Ok(())
})
.wait_before_exiting(),
);
}
let app = Self { let app = Self {
compositor, compositor,

Loading…
Cancel
Save