history tweaks

This commit is contained in:
2025-01-14 16:17:12 -05:00
parent 41c611c0ca
commit 09a6ad3ae2
3 changed files with 4 additions and 5 deletions

View File

@ -36,9 +36,8 @@ impl History {
.open(history_file.as_path())
.map_or_display(|mut file| {
let newline_maybe = if fs_history.is_empty() { "" } else { "\n" };
if let Err(write_err) = file.write_all(format!("{newline_maybe}{}", self.history.join("\n")).as_bytes()) {
session::shell_error(write_err);
};
let formatted = format!("{newline_maybe}{}", self.history.join("\n"));
file.write_all(formatted.as_bytes()).unwrap_or_else(session::shell_error)
});
}
}