1
0
mirror of https://github.com/sharkdp/bat.git synced 2024-10-06 02:41:06 +01:00

Print error if Default.tmTheme is not available

closes #15
This commit is contained in:
sharkdp 2018-04-25 23:34:36 +02:00
parent 716b261efd
commit 64de2a44d5

View File

@ -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();