From 48d77d141a00ec1f4a314e1b8f5e60df1528bc75 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 25 Jan 2014 22:38:37 -0500 Subject: [PATCH] Fix diff stat highlighting of file with no changes This fixes the case where there are files with 10 or more lines of changes as pointed out by @majutsushi in #215. test1.txt | 0 test2.txt | 1236 +++++++++++++++++++++++++++++++++++++++++++++++++ --- tig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tig.c b/tig.c index d39b1a6..0271286 100644 --- a/tig.c +++ b/tig.c @@ -4699,7 +4699,7 @@ diff_common_read(struct view *view, const char *data, struct diff_state *state) bool has_histogram = data[len - 1] == '-' || data[len - 1] == '+'; bool has_bin_diff = pipe && strstr(pipe, "Bin") && strstr(pipe, "->"); bool has_rename = data[len - 1] == '0' && (strstr(data, "=>") || !strncmp(data, " ...", 4)); - bool has_no_change = pipe && !strcmp(pipe, "| 0"); + bool has_no_change = pipe && strstr(pipe, " 0"); if (pipe && (has_histogram || has_bin_diff || has_rename || has_no_change)) { return add_line_text(view, data, LINE_DIFF_STAT) != NULL; -- 2.11.4.GIT