v0.4.3 : persistance du theme actif choisi
- le REPL 'theme <name>' applique ET sauvegarde le theme (settings.theme dans le fichier de config actif, cree s'il manque) via persist_setting - correction racine : config::merge ignorait settings.theme - la valeur persistee n etait jamais relue au chargement, le theme par defaut etait toujours reapplique apres un redemarrage - 'am --theme <name>' reste un one-shot ; config set settings.theme <nom> fonctionne egalement - aides mises a jour (banniere, help theme) - tests de persistance + relecture au demarrage, man pages regenerees, version 0.4.3
This commit is contained in:
+11
-4
@@ -706,7 +706,7 @@ pub fn banner_box(
|
||||
rows.push(inner(dim(&line, theme, color)));
|
||||
}
|
||||
rows.push(inner(dim(
|
||||
" 'am --theme <name>' to switch · settings.theme in the config",
|
||||
" 'theme <name>' to switch (saved) · 'am --theme <name>' for a one-shot",
|
||||
theme,
|
||||
color,
|
||||
)));
|
||||
@@ -1831,6 +1831,15 @@ fn theme_command(app: &App, arg: Option<&str>) {
|
||||
Some(name) => match crate::theme::find(name) {
|
||||
Some(t) => {
|
||||
app.set_theme(t);
|
||||
// Persist the choice (settings.theme in the active config
|
||||
// file) so it survives an exit and restart.
|
||||
if let Err(e) =
|
||||
crate::commands::config_cmd::persist_setting(app, "settings.theme", t.name)
|
||||
{
|
||||
app.log.error(format!(
|
||||
"theme applied for this session, but it could not be saved to the config: {e:#}"
|
||||
));
|
||||
}
|
||||
let color = app.color();
|
||||
println!(
|
||||
"{} {}",
|
||||
@@ -1871,9 +1880,7 @@ fn print_theme_status(app: &App) {
|
||||
println!(" {}", theme.dimmed(&format!("⇄ {}", others.join(" · "))));
|
||||
println!(
|
||||
" {}",
|
||||
theme.dimmed(
|
||||
"'theme <name>' to switch · '--theme <name>' or settings.theme to change the default"
|
||||
)
|
||||
theme.dimmed("'theme <name>' to switch (saved to the config) · 'am --theme <name>' for a one-shot")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user