patch 9.1.1072: 'diffopt' "linematch" cannot be used with {n} less than 10

Commit: 
https://github.com/vim/vim/commit/ccd7f454fcac2f99085d4f50e79c111c02741166
Author: zeertzjq <zeert...@outlook.com>
Date:   Mon Feb 3 18:49:49 2025 +0100

    patch 9.1.1072: 'diffopt' "linematch" cannot be used with {n} less than 10
    
    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 <zeert...@outlook.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/diff.c b/src/diff.c
index 41d61b1b5..d7433349a 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -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);
diff --git a/src/testdir/gen_opt_test.vim b/src/testdir/gen_opt_test.vim
index 30de28607..2dfb070c8 100644
--- a/src/testdir/gen_opt_test.vim
+++ b/src/testdir/gen_opt_test.vim
@@ -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']],
diff --git a/src/version.c b/src/version.c
index b953f905a..dd500d157 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1072,
 /**/
     1071,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1tf0jy-003Y9x-IM%40256bit.org.

Raspunde prin e-mail lui