summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStéphane Blondon <stephane.blondon@gmail.com>2024-04-14 17:17:58 +0200
committerMartin Nordholts <enselic@gmail.com>2024-04-19 11:44:47 +0200
commit23ec43316708b51f96ac3f9b5fc486494205236b (patch)
tree2da1a7545fe0db31dc6df94d301b2c990ca6d4e5 /src
parent9eaed3e3f088d210467727201b0fb2b4e1e8f763 (diff)
display which theme is the default one in basic output
Diffstat (limited to 'src')
-rw-r--r--src/bin/bat/main.rs9
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}")?;
}
}