File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ my $reset_color = color("reset");
32
32
my $bold = color(" bold" );
33
33
my $meta_color = " " ;
34
34
35
+ # Set the diff highlight colors from the config
36
+ init_diff_highlight_colors();
37
+
35
38
my ($file_1 ,$file_2 );
36
39
my $args = argv(); # Hashref of all the ARGV stuff
37
40
my $last_file_seen = " " ;
@@ -1039,4 +1042,12 @@ sub yes_no {
1039
1042
}
1040
1043
}
1041
1044
1045
+ sub init_diff_highlight_colors {
1046
+ $DiffHighlight::NEW_HIGHLIGHT [0] = git_ansi_color(git_config(' color.diff-highlight.newnormal' )) || color(" 2_bold" );
1047
+ $DiffHighlight::NEW_HIGHLIGHT [1] = git_ansi_color(git_config(' color.diff-highlight.newhighlight' )) || color(" 2_bold" ) . color(" on_22" );
1048
+
1049
+ $DiffHighlight::OLD_HIGHLIGHT [0] = git_ansi_color(git_config(' color.diff-highlight.oldnormal' )) || color(" 1_bold" );
1050
+ $DiffHighlight::OLD_HIGHLIGHT [1] = git_ansi_color(git_config(' color.diff-highlight.oldhighlight' )) || color(" 1_bold" ) . color(" on_52" );
1051
+ }
1052
+
1042
1053
# vim: tabstop=4 shiftwidth=4 noexpandtab autoindent softtabstop=4
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ my $NULL = File::Spec->devnull();
12
12
# Highlight by reversing foreground and background. You could do
13
13
# other things like bold or underline if you prefer.
14
14
our @OLD_HIGHLIGHT = (
15
- color_config( ' color.diff-highlight.oldnormal ' , " \e [1;31m" ) ,
16
- color_config( ' color.diff-highlight.oldhighlight ' , " \e [1;31;48;5;52m" ) ,
15
+ " \e [1;31m" ,
16
+ " \e [1;31;48;5;52m" ,
17
17
" \x1b [27m" ,
18
18
);
19
19
our @NEW_HIGHLIGHT = (
20
- color_config( ' color.diff-highlight.newnormal ' , " \e [1;32m" ) ,
21
- color_config( ' color.diff-highlight.newhighlight ' , " \e [1;32;48;5;22m" ) ,
20
+ " \e [1;32m" ,
21
+ " \e [1;32;48;5;22m" ,
22
22
$OLD_HIGHLIGHT [2],
23
23
);
24
24
You can’t perform that action at this time.
0 commit comments