]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1072: 'diffopt' "linematch" cannot be used with {n} less than 10 v9.1.1072
authorzeertzjq <zeertzjq@outlook.com>
Mon, 3 Feb 2025 17:49:49 +0000 (18:49 +0100)
committerChristian Brabandt <cb@256bit.org>
Mon, 3 Feb 2025 17:49:49 +0000 (18:49 +0100)
Problem:  'diffopt' "linematch" cannot be used with {n} less than 10
          digits (after v9.1.1022)
Solution: Fix off-by-one error when checking for digit (zeertzjq)

closes: #16577

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/diff.c
src/testdir/gen_opt_test.vim
src/version.c

index 41d61b1b569d22b09d521cede32ada7164943ff4..d7433349a46fe3311bba5bd0d1bcaa6e462fb3c0 100644 (file)
@@ -2795,7 +2795,7 @@ diffopt_changed(void)
            else
                return FAIL;
        }
-       else if (STRNCMP(p, "linematch:", 10) == 0 && VIM_ISDIGIT(p[11]))
+       else if (STRNCMP(p, "linematch:", 10) == 0 && VIM_ISDIGIT(p[10]))
        {
            p += 10;
            linematch_lines_new = getdigits(&p);
index 30de28607eae1ec7634380cc874198a694bbec69..2dfb070c8f9a67ac6af303adcbae603ca6e2a95d 100644 (file)
@@ -178,9 +178,11 @@ let test_values = {
       \                'icase', 'iwhite', 'iwhiteall', 'horizontal', 'vertical',
       \                'closeoff', 'hiddenoff', 'foldcolumn:0', 'foldcolumn:12',
       \                'followwrap', 'internal', 'indent-heuristic', 'algorithm:myers',
-      \                'algorithm:minimal', 'algorithm:patience',
-      \                'algorithm:histogram', 'icase,iwhite'],
-      \                ['xxx', 'foldcolumn:xxx', 'algorithm:xxx', 'algorithm:']],
+      \                'icase,iwhite', 'algorithm:minimal', 'algorithm:patience',
+      \                'algorithm:histogram', 'linematch:5'],
+      \                ['xxx', 'foldcolumn:', 'foldcolumn:x', 'foldcolumn:xxx',
+      \                'linematch:', 'linematch:x', 'linematch:xxx', 'algorithm:',
+      \                'algorithm:xxx', 'context:', 'context:x', 'context:xxx']],
       \ 'display': [['', 'lastline', 'truncate', 'uhex', 'lastline,uhex'],
       \                ['xxx']],
       \ 'eadirection': [['', 'both', 'ver', 'hor'], ['xxx', 'ver,hor']],
index b953f905adb97f807a25410b6301c69ae5185768..dd500d157b4a767e7aafb79197e42c2d5252f42f 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1072,
 /**/
     1071,
 /**/