patch 9.1.1009: diff feature can be improved
Problem: diff feature can be improved
Solution: include the linematch diff alignment algorithm
(Jonathon)
closes: #9661
Signed-off-by: Jonathon <jonathonwhite@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/drawline.c b/src/drawline.c
index f383857..a6b6317 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1467,10 +1467,13 @@
}
#ifdef FEAT_DIFF
- wlv.filler_lines = diff_check(wp, lnum);
- if (wlv.filler_lines < 0)
+
+ int linestatus = 0;
+ wlv.filler_lines = diff_check_with_linestatus(wp, lnum, &linestatus);
+
+ if (wlv.filler_lines < 0 || linestatus < 0)
{
- if (wlv.filler_lines == -1)
+ if (wlv.filler_lines == -1 || linestatus == -1)
{
if (diff_find_change(wp, lnum, &change_start, &change_end))
wlv.diff_hlf = HLF_ADD; // added line
@@ -1480,12 +1483,17 @@
wlv.diff_hlf = HLF_CHD; // changed line
}
else
- wlv.diff_hlf = HLF_ADD; // added line
- wlv.filler_lines = 0;
+ wlv.diff_hlf = HLF_ADD;
+
+ if (linestatus == 0)
+ wlv.filler_lines = 0;
+
area_highlighting = TRUE;
}
+
if (lnum == wp->w_topline)
wlv.filler_lines = wp->w_topfill;
+
wlv.filler_todo = wlv.filler_lines;
#endif