mirror of
https://github.com/sharkdp/bat.git
synced 2025-08-10 08:08:07 +02:00
display which theme is the default one in basic output
This commit is contained in:
committed by
Martin Nordholts
parent
9eaed3e3f0
commit
23ec433167
@ -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}")?;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user