diff src/diff.c @ 15103:9339601e7a31 v8.1.0562

patch 8.1.0562: parsing of 'diffopt' is slightly wrong commit https://github.com/vim/vim/commit/b6fc72851c45a36a370f9516c68508e47b41c4c1 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 4 22:24:16 2018 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Tue, 04 Dec 2018 22:30:07 +0100
parents 9c2352253376
children 55ccc2d353bd
line wrap: on
line diff
--- a/src/diff.c
+++ b/src/diff.c
@@ -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;