From bd2d0edcbf4e98e05edff13f344865fcafac56b5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 1 Dec 2022 09:05:25 +0800 Subject: fix: clang warnings (#21247) --- src/nvim/diff.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/diff.c') diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 64a142fa0e..ac637c2c70 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -1946,7 +1946,6 @@ static void calculate_topfill_and_topline(const int fromidx, const int toidx, co virtual_lines_passed -= from_topfill; // count the same amount of virtual lines in the toidx buffer - curdif = thistopdiff; int curlinenum_to = thistopdiff->df_lnum[toidx]; int linesfiller = 0; count_filler_lines_and_topline(&curlinenum_to, &linesfiller, @@ -2628,7 +2627,7 @@ bool diff_find_change(win_T *wp, linenr_T lnum, int *startp, int *endp) break; } } - if (dp->is_linematched) { + if (dp != NULL && dp->is_linematched) { while (dp && dp->df_next && lnum == dp->df_count[idx] + dp->df_lnum[idx] && dp->df_next->df_lnum[idx] == lnum) { -- cgit