0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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)
This commit is contained in:
Bram Moolenaar
2018-12-04 22:24:16 +01:00
parent 9719568533
commit b6fc72851c
6 changed files with 21 additions and 7 deletions

View File

@@ -2173,6 +2173,7 @@ diffopt_changed(void)
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 @@ diffopt_changed(void)
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 @@ diffopt_changed(void)
++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;