]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0634: Ctrl-P not working by default v9.1.0634
authorChristian Brabandt <cb@256bit.org>
Sun, 28 Jul 2024 19:16:48 +0000 (21:16 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 28 Jul 2024 19:16:48 +0000 (21:16 +0200)
Problem:  Ctrl-P not working by default
          (Jesse Pavel, after v9.1.0598)
Solution: Revert part of v9.1.0598 and set cur_match_pos
          correctly according to compl_dir_forward()

fixes: #15370
closes: #15379

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/insexpand.c
src/testdir/test_ins_complete.vim
src/version.c

index 00a7b75684137bf97bd6165f82affeacc7fe46ed..3a168848fed4efd77ba68182b8bd1bdd0e50714b 100644 (file)
@@ -4012,11 +4012,8 @@ ins_compl_get_exp(pos_T *ini)
        st.ins_buf = curbuf;  // In case the buffer was wiped out.
 
     compl_old_match = compl_curr_match;        // remember the last current match
-    if (in_fuzzy)
-       st.cur_match_pos = (compl_dir_forward())
+    st.cur_match_pos = (compl_dir_forward())
                                    ? &st.last_match_pos : &st.first_match_pos;
-    else
-       st.cur_match_pos = &st.last_match_pos;
 
     // For ^N/^P loop over all the flags/windows/buffers in 'complete'.
     for (;;)
index f3f6eac23f9b6d4175dab1ca3527f0ab33974895..cf688ac6a6d635ce3ee4a1233d9b2a0946685580 100644 (file)
@@ -2688,4 +2688,14 @@ func Test_complete_fuzzy_match_tie()
   set completeopt&
 endfunc
 
+func Test_complete_backwards_default()
+  new
+  call append(1, ['foobar', 'foobaz'])
+  new
+  call feedkeys("i\<c-p>", 'tx')
+  call assert_equal('foobaz', getline('.'))
+  bw!
+  bw!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab nofoldenable
index 373cd8cb5c67e0d8df98affecea7a609bbe3d42a..6520422955da491adf12b74bcff3335bc2e71c7e 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    634,
 /**/
     633,
 /**/