patch 9.1.1272: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N
Commit: https://github.com/vim/vim/commit/3e50a28a03d136c1e0c1f4fabe50d97faaf08c5c Author: glepnir <glephun...@gmail.com> Date: Thu Apr 3 21:17:06 2025 +0200 patch 9.1.1272: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N Problem: completion: in keyword completion Ctrl_P cannot go back after Ctrl_N Solution: in find_compl_when_fuzzy() always return first match of array, after Ctrl_P use compl_shown_match->cp_next instead of compl_first_match. (glepnir) closes: #17043 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 de3d51982..9df044539 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -4831,7 +4831,8 @@ find_comp_when_fuzzy(void) if ((is_forward && compl_selected_item == compl_match_arraysize - 1) || (is_backward && compl_selected_item == 0)) - return compl_first_match != compl_shown_match ? compl_first_match : + return compl_first_match != compl_shown_match ? + (is_forward ? compl_shown_match->cp_next : compl_first_match) : (compl_first_match->cp_prev ? compl_first_match->cp_prev : NULL); if (is_forward) diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index f60aba8d7..bc971b5da 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -2834,6 +2834,8 @@ func Test_complete_opt_fuzzy() call assert_equal('bar', getline('.')) call feedkeys("Sb\<C-X>\<C-N>\<C-Y>\<ESC>", 'tx') call assert_equal('blue', getline('.')) + call feedkeys("Sb\<C-X>\<C-P>\<C-N>\<C-Y>\<ESC>", 'tx') + call assert_equal('b', getline('.')) " clean up set omnifunc= diff --git a/src/version.c b/src/version.c index f77ff4794..28c024866 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 */ +/**/ + 1272, /**/ 1271, /**/ -- -- 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/E1u0QGL-00G3By-J7%40256bit.org.