summaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-06-30 08:49:01 -0400
committerDan Davison <dandavison7@gmail.com>2020-06-30 09:18:54 -0400
commit77e98911848c361b5dbc207304ffa6c5c687d5bc (patch)
tree763766caaa91ed4befa4bffa59766dc7314847aa /src/features
parenteb202089a504098380f5454fb5c8858917148fd7 (diff)
Use theme default colors for dark-mode line numbers
Diffstat (limited to 'src/features')
-rw-r--r--src/features/line_numbers.rs27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/features/line_numbers.rs b/src/features/line_numbers.rs
index d29ed9e0..a7522381 100644
--- a/src/features/line_numbers.rs
+++ b/src/features/line_numbers.rs
@@ -2,6 +2,7 @@ use ansi_term;
use lazy_static::lazy_static;
use regex::Regex;
+use crate::color;
use crate::config;
use crate::features::OptionValueFunction;
use crate::style::Style;
@@ -17,20 +18,36 @@ pub fn make_feature() -> Vec<(String, OptionValueFunction)> {
(
"line-numbers-minus-style",
String,
- Some("color.diff.old"),
- _opt => "red"
+ None,
+ opt => if opt.computed.is_light_mode {
+ "red".to_string()
+ } else {
+ color::color_to_string(
+ color::get_minus_emph_background_color_default(
+ opt.computed.is_light_mode,
+ opt.computed.true_color,
+ ))
+ }
),
(
"line-numbers-zero-style",
String,
None,
- _opt => "#bbbbbb"
+ opt => if opt.computed.is_light_mode {"#dddddd"} else {"#444444"}
),
(
"line-numbers-plus-style",
String,
- Some("color.diff.new"),
- _opt => "green"
+ None,
+ opt => if opt.computed.is_light_mode {
+ "green".to_string()
+ } else {
+ color::color_to_string(
+ color::get_plus_emph_background_color_default(
+ opt.computed.is_light_mode,
+ opt.computed.true_color,
+ ))
+ }
)
])
}