diff --git a/include/tig/options.h b/include/tig/options.h index a17456a0c..55d684c89 100644 --- a/include/tig/options.h +++ b/include/tig/options.h @@ -37,6 +37,8 @@ typedef struct view_column *view_settings; _(commit_order, enum commit_order, VIEW_LOG_LIKE) \ _(diff_context, int, VIEW_DIFF_LIKE) \ _(diff_noprefix, bool, VIEW_NO_FLAGS) \ + // TODO: _(diff_dstprefix, + // TODO: _(diff_srcprefix, _(diff_options, const char **, VIEW_DIFF_LIKE) \ _(diff_highlight, const char *, VIEW_DIFF_LIKE) \ _(word_diff, bool, VIEW_DIFF_LIKE) \ diff --git a/src/diff.c b/src/diff.c index 23746b41b..96793ccce 100644 --- a/src/diff.c +++ b/src/diff.c @@ -655,8 +655,9 @@ diff_trace_origin(struct view *view, struct line *line) for (; diff < line && !file; diff++) { const char *data = box_text(diff); - if (!prefixcmp(data, "--- a/")) { - file = data + STRING_SIZE("--- a/"); + // TODO: make a diff file name parser generic + if (!prefixcmp(data, "--- ")) { + file = data + (opt_diff_noprefix ? STRING_SIZE("--- ") : STRING_SIZE("--- a/")); break; } } @@ -735,6 +736,7 @@ diff_get_pathname(struct view *view, struct line *line, bool old) if (!header) return NULL; + // TODO: make a diff file name parser generic name = box_text(header); if (old ? !prefixcmp(name, "--- ") : !prefixcmp(name, "+++ ")) name += STRING_SIZE("+++ "); diff --git a/src/options.c b/src/options.c index 0bd0c0f7f..7d1a5b7ce 100644 --- a/src/options.c +++ b/src/options.c @@ -1534,6 +1534,10 @@ read_repo_config_option(char *name, size_t namelen, char *value, size_t valuelen else if (!strcmp(name, "diff.noprefix")) parse_bool(&opt_diff_noprefix, value); + // TODO: else if (!strcmp(name, "diff.dstprefix")) and store it somewhere + + // TODO: else if (!strcmp(name, "diff.srcprefix")) and store it somewhere + else if (!strcmp(name, "status.showuntrackedfiles")) opt_status_show_untracked_files = !!strcmp(value, "no"), opt_status_show_untracked_dirs = !strcmp(value, "all");