Print error if Default.tmTheme is not available

closes #15
pull/24/head
sharkdp 6 years ago
parent 716b261efd
commit 64de2a44d5

@ -196,7 +196,10 @@ fn run(matches: &ArgMatches) -> Result<()> {
let theme_dir = home_dir.join(".config").join("bat").join("themes");
let theme_set = ThemeSet::load_from_folder(theme_dir)
.map_err(|_| io::Error::new(ErrorKind::Other, "Could not load themes"))?;
let theme = &theme_set.themes["Default"];
let theme = &theme_set.themes.get("Default").ok_or(io::Error::new(
ErrorKind::Other,
"Could not load default theme (~/.config/bat/themes/Default.tmTheme)",
))?;
// TODO: let mut syntax_set = SyntaxSet::load_defaults_nonewlines();
let mut syntax_set = SyntaxSet::new();

Loading…
Cancel
Save