File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -375,8 +375,19 @@ sub mark_empty_line {
375
375
my $reset_color = " \e\\ [0?m" ;
376
376
my $reset_escape = " \e\[ m" ;
377
377
my $invert_color = " \e\[ 7m" ;
378
-
379
- $line =~ s / ^($ansi_color_regex)[+-]$reset_color\s *$/ $invert_color$1 $reset_escape \n / ;
378
+ my $add_color = $DiffHighlight::NEW_HIGHLIGHT [1];
379
+ my $del_color = $DiffHighlight::OLD_HIGHLIGHT [1];
380
+
381
+ # This captures lines that do not have any ANSI in them (raw vanilla diff)
382
+ if ($line eq " +\n " ) {
383
+ $line = $invert_color . $add_color . " " . color(' reset' ) . " \n " ;
384
+ # This captures lines that do not have any ANSI in them (raw vanilla diff)
385
+ } elsif ($line eq " -\n " ) {
386
+ $line = $invert_color . $del_color . " " . color(' reset' ) . " \n " ;
387
+ # This handles everything else
388
+ } else {
389
+ $line =~ s / ^($ansi_color_regex)[+-]$reset_color\s *$/ $invert_color$1 $reset_escape \n / ;
390
+ }
380
391
381
392
return $line ;
382
393
}
You can’t perform that action at this time.
0 commit comments