Skip to content

Commit

Permalink
fix original use case
Browse files Browse the repository at this point in the history
  • Loading branch information
koutcher committed May 23, 2024
1 parent 7d05ccf commit 31b8c11
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,10 @@ diff_trace_origin(struct view *view, struct line *line)

for (; diff < line && !file; diff++) {
const char *data = box_text(diff);

if (!prefixcmp(data, "--- ")) {
const char *data_n1 = box_text(diff+1);
const char *data_n2 = box_text(diff+2);
if(!prefixcmp(data_n1, "+++ ") && !prefixcmp(data_n2, "@@ ")){
file = data + STRING_SIZE("--- ");
break;
}
file = data + (opt_diff_noprefix ? STRING_SIZE("--- ") : STRING_SIZE("--- a/"));
break;
}
}

Expand Down

0 comments on commit 31b8c11

Please sign in to comment.