Skip to content

Commit 5d567c1

Browse files
committed
regex: factor out single-sequence ansi_regex
1 parent 1a1445c commit 5d567c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

diff-so-fancy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ my $ruler_width = git_config("diff-so-fancy.rulerWidth", undef);
2727
my $git_strip_prefix = git_config_boolean("diff.noprefix","false");
2828
my $has_stdin = has_stdin();
2929

30-
my $ansi_color_regex = qr/(\e\[([0-9]{1,3}(;[0-9]{1,3}){0,10})[mK])?/;
30+
my $ansi_regex = qr/\e\[([0-9]{1,3}(;[0-9]{1,3}){0,10})[mK]/;
31+
my $ansi_color_regex = qr/(${ansi_regex})?/;
3132
my $reset_color = color("reset");
3233
my $bold = color("bold");
3334
my $meta_color = "";

0 commit comments

Comments
 (0)