diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-20 15:16:40 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-20 15:16:40 -0800 |
| commit | 3c38aef78c637f933da7111bc55b77d94a824afa (patch) | |
| tree | c8ee7644d7de108a0b806aedf257880c86042625 /print.c | |
| parent | ab275800b3efbf67273c3efd4a23d1016f21ed82 (diff) | |
Bugfix for replacement coloring
Diffstat (limited to 'print.c')
| -rw-r--r-- | print.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |
