Add an even simple example

This commit is contained in:
sharkdp
2020-03-21 21:45:03 +01:00
committed by David Peter
parent 2c2861db6a
commit dfe5eb3e98
3 changed files with 48 additions and 23 deletions

View File

@ -160,12 +160,14 @@ impl HighlightingAssets {
match self.theme_set.themes.get(theme) {
Some(theme) => theme,
None => {
use ansi_term::Colour::Yellow;
eprintln!(
"{}: Unknown theme '{}', using default.",
Yellow.paint("[bat warning]"),
theme
);
if theme != "" {
use ansi_term::Colour::Yellow;
eprintln!(
"{}: Unknown theme '{}', using default.",
Yellow.paint("[bat warning]"),
theme
);
}
&self.theme_set.themes[self.fallback_theme.unwrap_or(Self::default_theme())]
}
}