From: Johannes Schindelin via GitGitGadget Date: Tue, 10 Nov 2020 23:42:16 GMT Subject: [PATCH 6/9] add -p (built-in): do not color the progress indicator separately Message-ID: <059344bfaf40da90dbe951a58f826b1ed21b5e12.1605051739.git.gitgitgadget@gmail.com> In-Reply-To: From: Johannes Schindelin The Perl version of this command colors the progress indicator and the prompt message in one go, let's do the same in the built-in version. Signed-off-by: Johannes Schindelin --- add-patch.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/add-patch.c b/add-patch.c index 33a24f58fe..6f4c187238 100644 --- a/add-patch.c +++ b/add-patch.c @@ -1456,15 +1456,15 @@ static int patch_update_file(struct add_p_state *s, else prompt_mode_type = PROMPT_HUNK; - color_fprintf(stdout, s->s.prompt_color, - "(%"PRIuMAX"/%"PRIuMAX") ", + printf("%s(%"PRIuMAX"/%"PRIuMAX") ", s->s.prompt_color, (uintmax_t)hunk_index + 1, (uintmax_t)(file_diff->hunk_nr ? file_diff->hunk_nr : 1)); - color_fprintf(stdout, s->s.prompt_color, - _(s->mode->prompt_mode[prompt_mode_type]), - s->buf.buf); + printf(_(s->mode->prompt_mode[prompt_mode_type]), + s->buf.buf); + if (*s->s.reset_color) + fputs(s->s.reset_color, stdout); fflush(stdout); if (read_single_character(s) == EOF) break; -- gitgitgadget