From 3c38aef78c637f933da7111bc55b77d94a824afa Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 20 Jan 2021 15:16:40 -0800 Subject: Bugfix for replacement coloring --- print.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3