1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-05 19:11:42 +00:00

Load customized themes in addition to defaults

- New themes in `$BAT_CONFIG_DIR/themes` are now loaded *in addition* to
  the default themes (they may also override).
- The `Default.tmTheme` symlink is not necessary anymore.

This relates to #172
This commit is contained in:
sharkdp
2018-08-20 21:39:21 +02:00
parent 2df3305b94
commit 052425b12f
6 changed files with 23 additions and 14 deletions
+3 -1
View File
@@ -9,6 +9,8 @@ use style::{OutputComponent, OutputComponents, OutputWrap};
#[cfg(windows)]
use ansi_term;
use assets::BAT_THEME_DEFAULT;
pub struct App {
pub matches: ArgMatches<'static>,
interactive_output: bool,
@@ -271,7 +273,7 @@ impl App {
.value_of("theme")
.map(String::from)
.or_else(|| env::var("BAT_THEME").ok())
.unwrap_or(String::from("Default")),
.unwrap_or(String::from(BAT_THEME_DEFAULT)),
line_range: transpose(self.matches.value_of("line-range").map(LineRange::from))?,
})
}