patch 9.1.1383: completion: 'isexpand' option does not handle space char correct

Commit: 
https://github.com/vim/vim/commit/8d0e42b71023144e6db17534da41ffecbd0b655f
Author: glepnir <glephun...@gmail.com>
Date:   Mon May 12 20:28:28 2025 +0200

    patch 9.1.1383: completion: 'isexpand' option does not handle space char 
correct
    
    Problem:  When a space character is used as a trigger in 'isexpand' option
              it doesn't get recognized because skip_to_option_part() skips
              spaces after a comma, treating them as option separators
              rather than option value (after v9.1.1341)
    Solution: manually set the part to a space character (glepnir).
    
    closes: #17305
    
    Signed-off-by: glepnir <glephun...@gmail.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/insexpand.c b/src/insexpand.c
index bb280fa46..5f5a5b905 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -3665,7 +3665,15 @@ f_complete_match(typval_T *argvars, typval_T *rettv)
 
        while (*p != NUL)
        {
-           int len = copy_option_part(&p, part, MAXPATHL, ",");
+           int     len = 0;
+           if (*p == ',' && *(p+1) == ' ' && (*(p+2) == ',' || *(p+2) == NUL))
+           {
+               part[0] = ' ';
+               len = 1;
+               p++;
+           }
+           else
+               len = copy_option_part(&p, part, MAXPATHL, ",");
 
            if (len > 0 && len <= col)
            {
diff --git a/src/testdir/test_ins_complete.vim 
b/src/testdir/test_ins_complete.vim
index f7292ea34..741cc9d9c 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -4504,6 +4504,10 @@ func Test_complete_match()
   call feedkeys("Sabc, \<ESC>:let g:result=complete_match()\<CR>", 'tx')
   call assert_equal([[4, ',']], g:result)
 
+  set ise=\ ,=
+  call feedkeys("Sif true  \<ESC>:let g:result=complete_match()\<CR>", 'tx')
+  call assert_equal([[8, ' ']], g:result)
+
   bw!
   unlet g:result
   set isexpand&
diff --git a/src/version.c b/src/version.c
index 816ce5c15..4a9ad83dd 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 */
+/**/
+    1383,
 /**/
     1382,
 /**/

-- 
-- 
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/E1uEY9F-006UCa-5Z%40256bit.org.

Raspunde prin e-mail lui