diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-12-20 16:37:10 +0000 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-12-20 16:37:10 +0000 |
commit | 8b3d936c7f8544776c9fd0f69fa67697e98bf726 (patch) | |
tree | a8d92eaadc83bfe5818112950a94e4282b609e9d | |
parent | 334dec742d78d6d72715eaefaaa1c8313c6315fb (diff) |
-rw-r--r-- | src/features/dark.rs | 13 | ||||
-rw-r--r-- | src/features/light.rs | 13 | ||||
-rw-r--r-- | src/features/mod.rs | 2 | ||||
-rw-r--r-- | src/options/set.rs | 4 | ||||
-rw-r--r-- | src/options/theme.rs | 4 |
5 files changed, 32 insertions, 4 deletions
diff --git a/src/features/dark.rs b/src/features/dark.rs new file mode 100644 index 00000000..c326adc4 --- /dev/null +++ b/src/features/dark.rs @@ -0,0 +1,13 @@ +use crate::features::OptionValueFunction; +use crate::options::theme; + +pub fn make_feature() -> Vec<(String, OptionValueFunction)> { + builtin_feature!([ + ( + "theme", + String, + None, + _opt => theme::DEFAULT_DARK_SYNTAX_THEME + ) + ]) +} diff --git a/src/features/light.rs b/src/features/light.rs new file mode 100644 index 00000000..c326adc4 --- /dev/null +++ b/src/features/light.rs @@ -0,0 +1,13 @@ +use crate::features::OptionValueFunction; +use crate::options::theme; + +pub fn make_feature() -> Vec<(String, OptionValueFunction)> { + builtin_feature!([ + ( + "theme", + String, + None, + _opt => theme::DEFAULT_DARK_SYNTAX_THEME + ) + ]) +} diff --git a/src/features/mod.rs b/src/features/mod.rs index 67dbd6ba..9b0dbae6 100644 --- a/src/features/mod.rs +++ b/src/features/mod.rs @@ -83,9 +83,11 @@ macro_rules! builtin_feature { } pub mod color_only; +pub mod dark; pub mod diff_highlight; pub mod diff_so_fancy; pub mod hyperlinks; +pub mod light; pub mod line_numbers; pub mod navigate; pub mod raw; diff --git a/src/options/set.rs b/src/options/set.rs index 5b68ffec..eb4a0293 100644 --- a/src/options/set.rs +++ b/src/options/set.rs @@ -93,8 +93,8 @@ pub fn set_options( set_widths(opt, git_config, arg_matches, &option_names); // Set light, dark, and syntax-theme. - set_true_color(opt); - set__light__dark__syntax_theme__options(opt, git_config, arg_matches, &option_names); + // set_true_color(opt); + // set__light__dark__syntax_theme__options(opt, git_config, arg_matches, &option_names); theme::set__is_light_mode__syntax_theme__syntax_set(opt, assets); // HACK: make minus-line styles have syntax-highlighting iff side-by-side. diff --git a/src/options/theme.rs b/src/options/theme.rs index ae831202..a778965c 100644 --- a/src/options/theme.rs +++ b/src/options/theme.rs @@ -48,8 +48,8 @@ const LIGHT_SYNTAX_THEMES: [&str; 7] = [ "Solarized (light)", ]; -const DEFAULT_LIGHT_SYNTAX_THEME: &str = "GitHub"; -const DEFAULT_DARK_SYNTAX_THEME: &str = "Monokai Extended"; +pub const DEFAULT_LIGHT_SYNTAX_THEME: &str = "GitHub"; +pub const DEFAULT_DARK_SYNTAX_THEME: &str = "Monokai Extended"; fn is_no_syntax_highlighting_syntax_theme_name(theme_name: &str) -> bool { theme_name.to_lowercase() == "none" |