From cc7479d87d366781b4cb47954e65a51c66c56bf8 Mon Sep 17 00:00:00 2001 From: Thomas Koutcher Date: Mon, 28 Oct 2024 19:43:39 +0100 Subject: [PATCH] Don't report an error when diff-highlight is killed intentionally --- NEWS.adoc | 1 + src/diff.c | 3 ++- src/pager.c | 3 ++- src/stage.c | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS.adoc b/NEWS.adoc index f3dad2cfc..5bbbdf4df 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -10,6 +10,7 @@ Bug fixes: - Fix `Ctrl-C` behavior within the Readline prompt. (#1342) - Fix message upon edit from diffstat without patch. - Fix missing dates in the refs view. + - Don't report an error when diff-highlight is killed intentionally. Improvements: diff --git a/src/diff.c b/src/diff.c index 0b8a51d75..d463591cd 100644 --- a/src/diff.c +++ b/src/diff.c @@ -520,7 +520,8 @@ diff_read(struct view *view, struct buffer *buf, bool force_stop) if (!buf) { if (!diff_done_highlight(state)) { - report("Failed run the diff-highlight program: %s", opt_diff_highlight); + if (!force_stop) + report("Failed to run the diff-highlight program: %s", opt_diff_highlight); return false; } diff --git a/src/pager.c b/src/pager.c index 144095785..94b817a33 100644 --- a/src/pager.c +++ b/src/pager.c @@ -142,7 +142,8 @@ pager_read(struct view *view, struct buffer *buf, bool force_stop) if (!buf) { if (!diff_done_highlight(view->private)) { - report("Failed run the diff-highlight program: %s", opt_diff_highlight); + if (!force_stop) + report("Failed to run the diff-highlight program: %s", opt_diff_highlight); return false; } diff --git a/src/stage.c b/src/stage.c index a10fb95f9..36276256a 100644 --- a/src/stage.c +++ b/src/stage.c @@ -798,7 +798,8 @@ stage_read(struct view *view, struct buffer *buf, bool force_stop) if (!buf) { if (!diff_done_highlight(&state->diff)) { - report("Failed run the diff-highlight program: %s", opt_diff_highlight); + if (!force_stop) + report("Failed to run the diff-highlight program: %s", opt_diff_highlight); return false; }