Fixed bug with adding accidental extra newlines
This commit is contained in:
parent
51d5872c71
commit
906b03609b
2
print.c
2
print.c
@ -395,7 +395,7 @@ void print_match(FILE *out, printer_t *pr, match_t *m)
|
||||
const char *after_last = context_after(pr, pr->pos);
|
||||
print_between(out, pr, pr->pos, after_last, pr->use_color ? color_normal : NULL);
|
||||
// Guarantee trailing newline
|
||||
if (pr->pos > pr->file->contents && pr->pos[-1] != '\n') fprintf(out, "\n");
|
||||
if (!pr->needs_line_number) fprintf(out, "\n");
|
||||
}
|
||||
if (pr->use_color) fprintf(out, "%s", color_normal);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user