Skip to content

Commit ada8462

Browse files
committed
Only reset color on newline if we were in a quote
1 parent 629176e commit ada8462

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/pretty.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,11 @@ static void print_post_contents(FILE* fp, const char* str, bool use_pad) {
158158

159159
/* Whenever we change line, reset color and quote state */
160160
if (first_of_line) {
161-
fprintf(fp, COL_POST);
162-
in_quote = false;
161+
if (in_quote)
162+
fprintf(fp, COL_POST);
163163
if (use_pad)
164164
print_pad(fp, POST_PAD);
165+
in_quote = false;
165166
}
166167

167168
/* Check if this character starts a quote, and what kind */

0 commit comments

Comments
 (0)