diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-09-27 21:34:08 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-09-27 21:34:08 -0700 |
| commit | c60c1db8a230bb6e834366d8766d4013680f06c4 (patch) | |
| tree | ace9f5665095e44a64102169763e515e39615a30 | |
| parent | b882e30bf7c7941480943c43bd15ef40aafe35ef (diff) | |
Bugfix for certain patterns (e.g. $$) that didn't trigger line number
printing
| -rw-r--r-- | bp.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -371,6 +371,12 @@ static int print_matches(FILE *out, file_t *f, pat_t *pattern) fprint_context(out, f, prev, m->start); if (print_opts.normal_color) fprintf(out, "%s", print_opts.normal_color); fprint_match(out, f->start, m, &print_opts); + size_t linenum = get_line_number(f, m->end); + if (last_line_num < (int)linenum) { + fprint_linenum(out, f, linenum, print_opts.normal_color); + fputc('\n', out); + last_line_num = (int)linenum; + } if (print_opts.normal_color) fprintf(out, "%s", print_opts.normal_color); prev = m->end; } |
