diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-30 08:13:31 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-30 08:13:31 -0400 |
commit | 1ea2c4e7af6c3a6e2165a14979458972d03ebda1 (patch) | |
tree | 2af46cb27e320b5e8252d0ad1ada70eab610e662 /src/options | |
parent | 7d03c25266d84e64bab3bbf3c1782b980e8f5385 (diff) |
Set light/dark mode before builtin features
Diffstat (limited to 'src/options')
-rw-r--r-- | src/options/set.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/options/set.rs b/src/options/set.rs index 7a2df4b6..4299d716 100644 --- a/src/options/set.rs +++ b/src/options/set.rs @@ -62,7 +62,13 @@ pub fn set_options( git_config.enabled = false; } } + + // Set light, dark, and syntax-theme. + set__light__dark__syntax_theme__options(opt, git_config, arg_matches); + theme::set__is_light_mode__syntax_theme__syntax_set(opt, assets); + let builtin_features = features::make_builtin_features(); + // Set features opt.features = gather_features( opt, builtin_features.keys().into_iter().collect(), @@ -80,9 +86,6 @@ pub fn set_options( .unwrap_or_else(|| "magenta reverse".to_string()) } - set__light__dark__syntax_theme__options(opt, &builtin_features, git_config, arg_matches); - theme::set__is_light_mode__syntax_theme__syntax_set(opt, assets); - set_options!( [ ("24-bit-color", true_color), @@ -143,7 +146,6 @@ pub fn set_options( #[allow(non_snake_case)] fn set__light__dark__syntax_theme__options( opt: &mut cli::Opt, - builtin_features: &HashMap<String, features::BuiltinFeature>, git_config: &mut Option<git_config::GitConfig>, arg_matches: &clap::ArgMatches, ) { @@ -153,12 +155,13 @@ fn set__light__dark__syntax_theme__options( process::exit(1); } }; + let empty_builtin_features = HashMap::new(); validate_light_and_dark(&opt); if !(opt.light || opt.dark) { set_options!( [("dark", dark), ("light", light)], opt, - builtin_features, + &empty_builtin_features, git_config, arg_matches, false @@ -168,7 +171,7 @@ fn set__light__dark__syntax_theme__options( set_options!( [("syntax-theme", syntax_theme)], opt, - builtin_features, + &empty_builtin_features, git_config, arg_matches, false |