aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--printing.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/printing.c b/printing.c
index 1ded099..ad1598c 100644
--- a/printing.c
+++ b/printing.c
@@ -16,8 +16,8 @@ typedef struct match_node_s {
struct match_node_s *next;
} match_node_t;
-static const char *color_hl = "\033[0;31;1m";
-static const char *color_hl2 = "\033[0;34;1m";
+static const char *color_match = "\033[0;31;1m";
+static const char *color_replace = "\033[0;34;1m";
static const char *color_normal = "\033[0m";
__attribute__((nonnull, pure))
@@ -265,13 +265,13 @@ void _print_match(FILE *out, printer_t *pr, match_t *m)
size_t line_end = get_line_number(pr->file, m->end);
size_t line = line_start;
- if (pr->use_color) printf("%s", color_hl2);
+ if (pr->use_color) printf("%s", color_replace);
const char *text = m->op->args.replace.text;
const char *end = &text[m->op->args.replace.len];
// TODO: clean up the line numbering code
for (const char *r = text; r < end; ) {
- print_line_number(out, pr, line > line_end ? 0 : line, pr->use_color ? color_hl2 : NULL);
+ print_line_number(out, pr, line > line_end ? 0 : line, pr->use_color ? color_replace : NULL);
// Capture substitution
if (*r == '@' && r[1] && r[1] != '@') {
@@ -279,7 +279,7 @@ 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) printf("%s", color_hl2);
+ if (pr->use_color) printf("%s", color_replace);
continue;
} else {
--r;
@@ -316,12 +316,12 @@ void _print_match(FILE *out, printer_t *pr, match_t *m)
prev <= child->end && child->end <= m->end))
continue;
if (child->start > prev)
- print_between(out, pr, prev, child->start, pr->use_color ? color_hl : NULL);
+ print_between(out, pr, prev, child->start, pr->use_color ? color_match : NULL);
_print_match(out, pr, child);
prev = child->end;
}
if (m->end > prev)
- print_between(out, pr, prev, m->end, pr->use_color ? color_hl : NULL);
+ print_between(out, pr, prev, m->end, pr->use_color ? color_match : NULL);
}
pr->pos = m->end;
}