diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-29 22:21:08 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-30 08:00:30 -0400 |
commit | 3b2f709bdc9058d14efacaa4bc58b994c0885aea (patch) | |
tree | 804811d2be9fc749139645fc49c508a5d914fe33 /src/options | |
parent | 32b7bdc066eee243171114ff7952ed573a410fda (diff) |
Allow "light" syntax themes to be used with dark mode and vice versa
Diffstat (limited to 'src/options')
-rw-r--r-- | src/options/preprocess.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/options/preprocess.rs b/src/options/preprocess.rs index 7fb7accd..c1951892 100644 --- a/src/options/preprocess.rs +++ b/src/options/preprocess.rs @@ -10,7 +10,6 @@ pub fn set__is_light_mode__syntax_theme__syntax_set( opt: &mut cli::Opt, assets: HighlightingAssets, ) { - _check_validity(&opt, &assets); let syntax_theme_name_from_bat_theme = env::get_env_var("BAT_THEME"); let (is_light_mode, syntax_theme_name) = syntax_theme::get_is_light_mode_and_theme_name( opt.syntax_theme.as_ref(), @@ -28,29 +27,3 @@ pub fn set__is_light_mode__syntax_theme__syntax_set( }; opt.computed.syntax_set = assets.syntax_set; } - -fn _check_validity(opt: &cli::Opt, assets: &HighlightingAssets) { - if let Some(ref syntax_theme) = opt.syntax_theme { - if !syntax_theme::is_no_syntax_highlighting_theme_name(&syntax_theme) { - if !assets.theme_set.themes.contains_key(syntax_theme.as_str()) { - return; - } - let is_light_syntax_theme = syntax_theme::is_light_theme(&syntax_theme); - if is_light_syntax_theme && opt.dark { - eprintln!( - "{} is a light syntax theme, but you supplied --dark. \ - If you use --syntax-theme, you do not need to supply --light or --dark.", - syntax_theme - ); - process::exit(1); - } else if !is_light_syntax_theme && opt.light { - eprintln!( - "{} is a dark syntax theme, but you supplied --light. \ - If you use --syntax-theme, you do not need to supply --light or --dark.", - syntax_theme - ); - process::exit(1); - } - } - } -} |