diff options
author | Stéphane Blondon <stephane.blondon@gmail.com> | 2024-04-14 17:17:58 +0200 |
---|---|---|
committer | Martin Nordholts <enselic@gmail.com> | 2024-04-19 11:44:47 +0200 |
commit | 23ec43316708b51f96ac3f9b5fc486494205236b (patch) | |
tree | 2da1a7545fe0db31dc6df94d301b2c990ca6d4e5 /src | |
parent | 9eaed3e3f088d210467727201b0fb2b4e1e8f763 (diff) |
display which theme is the default one in basic output
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/bat/main.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 78202539..027f4ec4 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -200,8 +200,8 @@ pub fn list_themes(cfg: &Config, config_dir: &Path, cache_dir: &Path) -> Result< let stdout = io::stdout(); let mut stdout = stdout.lock(); + let default_theme = HighlightingAssets::default_theme(); if config.colored_output { - let default_theme = HighlightingAssets::default_theme(); for theme in assets.themes() { let default_theme_info = if default_theme == theme { " (default)" @@ -230,7 +230,12 @@ pub fn list_themes(cfg: &Config, config_dir: &Path, cache_dir: &Path) -> Result< )?; } else { for theme in assets.themes() { - writeln!(stdout, "{theme}")?; + let default_theme_info = if default_theme == theme { + " (default)" + } else { + "" + }; + writeln!(stdout, "{theme}{default_theme_info}")?; } } |