v0.2.14 : barres verticales des cadres aux couleurs du theme + commande theme dans le shell (theme liste les themes, theme <name> change a chaud, completion et menu synchronises)

This commit is contained in:
2026-08-16 13:40:51 -04:00
parent 4b0f02a7c4
commit 2bbe45e508
5 changed files with 161 additions and 25 deletions
+11 -4
View File
@@ -8,6 +8,7 @@ use crate::output::Logger;
use crate::state::StateStore;
use crate::theme::{self, Theme};
use anyhow::{anyhow, Context, Result};
use std::cell::Cell;
use std::io::{IsTerminal, Write};
use std::path::PathBuf;
@@ -20,8 +21,9 @@ pub struct App {
pub catalog: Catalog,
pub state: StateStore,
pub log: Logger,
/// Active output color theme.
pub theme: &'static Theme,
/// Active output color theme (switchable at runtime with the REPL
/// 'theme <name>' command).
theme: Cell<&'static Theme>,
}
#[derive(Debug, Clone)]
@@ -90,7 +92,7 @@ impl App {
catalog,
state,
log,
theme,
theme: Cell::new(theme),
})
}
@@ -111,7 +113,12 @@ impl App {
}
pub fn theme(&self) -> &'static Theme {
self.theme
self.theme.get()
}
/// Switch the active theme (used by the REPL 'theme <name>' command).
pub fn set_theme(&self, theme: &'static Theme) {
self.theme.set(theme);
}
/// Ask the user for confirmation on stderr. Accepts y/yes/o/oui.