patch 9.1.0684: completion is inserted on Enter with "noselect"

Commit: 
https://github.com/vim/vim/commit/753794bae8a9401903b82e5c5d1f35a106aa912a
Author: glepnir <glephun...@gmail.com>
Date:   Tue Aug 20 19:58:44 2024 +0200

    patch 9.1.0684: completion is inserted on Enter with "noselect"
    
    Problem:  completion is inserted on Enter with "noselect"
              (Carman Fu)
    Solution: check noselect before update compl_shown_match
              (glepnir)
    
    fixes: #15526
    closes: #15530
    
    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 9a8d0faac..95076b7cd 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -1311,7 +1311,8 @@ ins_compl_build_pum(void)
                {
                    did_find_shown_match = TRUE;
                    max_fuzzy_score = compl->cp_score;
-                   compl_shown_match = compl;
+                   if (!compl_no_select)
+                       compl_shown_match = compl;
                }
 
                if (!shown_match_ok && compl == compl_shown_match && 
!compl_no_select)
diff --git a/src/testdir/test_ins_complete.vim 
b/src/testdir/test_ins_complete.vim
index becd0d8d0..aee33936f 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -2654,6 +2654,13 @@ func Test_complete_fuzzy_match()
   call feedkeys("Su\<C-X>\<C-L>\<C-P>\<Esc>0", 'tx!')
   call assert_equal('no one can save me but you', getline('.'))
 
+  " issue #15526
+  set completeopt=fuzzy,menuone,menu,noselect
+  call setline(1, ['Text', 'ToText', ''])
+  call cursor(2, 1)
+  call feedkeys("STe\<C-X>\<C-N>x\<CR>\<Esc>0", 'tx!')
+  call assert_equal('Tex', getline('.'))
+
   " clean up
   set omnifunc=
   bw!
diff --git a/src/version.c b/src/version.c
index 8d26a0dc0..12dae1560 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 */
+/**/
+    684,
 /**/
     683,
 /**/

-- 
-- 
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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1sgTNn-00EOzP-Iv%40256bit.org.

Raspunde prin e-mail lui