Skip to content

Commit

Permalink
Don't report an error when diff-highlight is killed intentionally
Browse files Browse the repository at this point in the history
  • Loading branch information
koutcher committed Oct 28, 2024
1 parent 914c617 commit cc7479d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 2 additions & 1 deletion src/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion src/stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit cc7479d

Please sign in to comment.