add -i: use reset_color
consistently
We already maintain a list of colors in the `add_i_state`, therefore we should use them. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
decc9ee4ea
commit
6f1a5caa0b
@ -672,7 +672,7 @@ static void render_hunk(struct add_p_state *s, struct hunk *hunk,
|
|||||||
if (len)
|
if (len)
|
||||||
strbuf_add(out, p, len);
|
strbuf_add(out, p, len);
|
||||||
else if (colored)
|
else if (colored)
|
||||||
strbuf_addf(out, "%s\n", GIT_COLOR_RESET);
|
strbuf_addf(out, "%s\n", s->s.reset_color);
|
||||||
else
|
else
|
||||||
strbuf_addch(out, '\n');
|
strbuf_addch(out, '\n');
|
||||||
}
|
}
|
||||||
@ -1065,7 +1065,7 @@ static void recolor_hunk(struct add_p_state *s, struct hunk *hunk)
|
|||||||
s->s.file_new_color :
|
s->s.file_new_color :
|
||||||
s->s.context_color);
|
s->s.context_color);
|
||||||
strbuf_add(&s->colored, plain + current, eol - current);
|
strbuf_add(&s->colored, plain + current, eol - current);
|
||||||
strbuf_addstr(&s->colored, GIT_COLOR_RESET);
|
strbuf_addstr(&s->colored, s->s.reset_color);
|
||||||
if (next > eol)
|
if (next > eol)
|
||||||
strbuf_add(&s->colored, plain + eol, next - eol);
|
strbuf_add(&s->colored, plain + eol, next - eol);
|
||||||
current = next;
|
current = next;
|
||||||
|
Reference in New Issue
Block a user