patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Problem: Parsing of 'diffopt' is slightly wrong.
Solution: Fix the parsing and add a test. (Jason Franklin, Christian
Brabandt)
diff --git a/src/diff.c b/src/diff.c
index 0399e79..7f7e15d 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -2173,6 +2173,7 @@
int diff_flags_new = 0;
int diff_foldcolumn_new = 2;
long diff_algorithm_new = 0;
+ long diff_indent_heuristic = 0;
tabpage_T *tp;
p = p_dip;
@@ -2236,7 +2237,7 @@
else if (STRNCMP(p, "indent-heuristic", 16) == 0)
{
p += 16;
- diff_algorithm_new |= XDF_INDENT_HEURISTIC;
+ diff_indent_heuristic = XDF_INDENT_HEURISTIC;
}
else if (STRNCMP(p, "internal", 8) == 0)
{
@@ -2276,6 +2277,8 @@
++p;
}
+ diff_algorithm_new |= diff_indent_heuristic;
+
/* Can't have both "horizontal" and "vertical". */
if ((diff_flags_new & DIFF_HORIZONTAL) && (diff_flags_new & DIFF_VERTICAL))
return FAIL;