diff options
Diffstat (limited to 'src/options/theme.rs')
| -rw-r--r-- | src/options/theme.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/options/theme.rs b/src/options/theme.rs index 474ace0..975c633 100644 --- a/src/options/theme.rs +++ b/src/options/theme.rs @@ -21,12 +21,8 @@ use crate::color::{ColorMode, ColorMode::*}; #[allow(non_snake_case)] pub fn set__color_mode__syntax_theme__syntax_set(opt: &mut cli::Opt, assets: HighlightingAssets) { - let syntax_theme_name_from_bat_theme = &opt.env.bat_theme; - let (color_mode, syntax_theme_name) = get_color_mode_and_syntax_theme_name( - opt.syntax_theme.as_ref(), - syntax_theme_name_from_bat_theme.as_ref(), - get_color_mode(opt), - ); + let (color_mode, syntax_theme_name) = + get_color_mode_and_syntax_theme_name(opt.syntax_theme.as_ref(), get_color_mode(opt)); opt.computed.color_mode = color_mode; opt.computed.syntax_theme = if is_no_syntax_highlighting_syntax_theme_name(&syntax_theme_name) { @@ -95,12 +91,10 @@ fn is_no_syntax_highlighting_syntax_theme_name(theme_name: &str) -> bool { /// | some_theme | (IGNORED) | yes | some_theme, light/dark mode (even if some_theme conflicts with light/dark) | /// | - | BAT_THEME | yes | BAT_THEME, light/dark mode (even if BAT_THEME conflicts with light/dark) | fn get_color_mode_and_syntax_theme_name( - theme_arg: Option<&String>, - bat_theme_env_var: Option<&String>, + syntax_theme: Option<&String>, mode: Option<ColorMode>, ) -> (ColorMode, String) { - let theme_arg = theme_arg.or(bat_theme_env_var); - match (theme_arg, mode) { + match (syntax_theme, mode) { (Some(theme), None) => (color_mode_from_syntax_theme(theme), theme.to_string()), (Some(theme), Some(mode)) => (mode, theme.to_string()), (None, None | Some(Dark)) => (Dark, DEFAULT_DARK_SYNTAX_THEME.to_string()), |
