aboutsummaryrefslogtreecommitdiff
path: root/print.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-20 15:16:40 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-20 15:16:40 -0800
commit3c38aef78c637f933da7111bc55b77d94a824afa (patch)
treec8ee7644d7de108a0b806aedf257880c86042625 /print.c
parentab275800b3efbf67273c3efd4a23d1016f21ed82 (diff)
Bugfix for replacement coloring
Diffstat (limited to 'print.c')
-rw-r--r--print.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/print.c b/print.c
index 21c1aee..eba311b 100644
--- a/print.c
+++ b/print.c
@@ -295,7 +295,10 @@ static void _print_match(FILE *out, printer_t *pr, match_t *m)
match_t *cap = get_capture(m, &r);
if (cap != NULL) {
_print_match(out, pr, cap);
- if (pr->use_color) fprintf(out, "%s", color_replace);
+ if (pr->use_color && current_color != color_replace) {
+ fprintf(out, "%s", color_replace);
+ current_color = color_replace;
+ }
continue;
} else {
--r;