1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Load saved theme from config file.
use fs;
use PathBuf;
use default_config_path;
use ThemeConfig;
/// Loads the saved theme name from the config file.
///
/// Attempts to read and parse the theme configuration from the specified
/// or default location.
///
/// # Arguments
///
/// * `config_path` - Optional custom path. If None, uses the default config location.
///
/// # Returns
///
/// `Some(theme_name)` if a saved theme was found and successfully parsed,
/// `None` otherwise (including if the file doesn't exist).
///
/// # Example
///
/// ```rust,no_run
/// use ratatui_toolkit::services::theme::persistence::load_saved_theme;
///
/// if let Some(theme_name) = load_saved_theme(None) {
/// println!("Using saved theme: {}", theme_name);
/// } else {
/// println!("No saved theme, using default");
/// }
/// ```