From 8cf413e450bfbe1a9887f2bbf869bf9462403a77 Mon Sep 17 00:00:00 2001 From: glepnir Date: Thu, 3 Apr 2025 14:09:49 +0800 Subject: vim-patch:9.1.1269: completion: compl_shown_match is updated when starting keyword completion Problem: compl_shown_match is updated when starting keyword completion and does not include fuzzy matching. Solution: Do not update compl_shown_match when starting keyword completion, since it is the one already selected by the keyword completion direction. (glepnir) closes: vim/vim#17033 https://github.com/vim/vim/commit/e4e4d1c381e9d0af55f6111e9bcaf98ad60461fc Co-authored-by: glepnir --- test/old/testdir/test_ins_complete.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim index 0e4f051f5a..187d0acc00 100644 --- a/test/old/testdir/test_ins_complete.vim +++ b/test/old/testdir/test_ins_complete.vim @@ -2861,6 +2861,12 @@ func Test_complete_opt_fuzzy() call feedkeys("i\=CompAnother()\\\", 'tx') call assert_equal("for", g:abbr) + set cot=menu,fuzzy + call feedkeys("Sblue\bar\b\\\\", 'tx') + call assert_equal('bar', getline('.')) + call feedkeys("Sb\\\\", 'tx') + call assert_equal('blue', getline('.')) + " clean up set omnifunc= bw! -- cgit From b01921cb55d795cf650c1026c514cb4179a6cada Mon Sep 17 00:00:00 2001 From: glepnir Date: Fri, 4 Apr 2025 13:51:38 +0800 Subject: vim-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: vim/vim#17043 https://github.com/vim/vim/commit/3e50a28a03d136c1e0c1f4fabe50d97faaf08c5c Co-authored-by: glepnir --- test/old/testdir/test_ins_complete.vim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim index 187d0acc00..5dd29bcc0a 100644 --- a/test/old/testdir/test_ins_complete.vim +++ b/test/old/testdir/test_ins_complete.vim @@ -2866,6 +2866,8 @@ func Test_complete_opt_fuzzy() call assert_equal('bar', getline('.')) call feedkeys("Sb\\\\", 'tx') call assert_equal('blue', getline('.')) + call feedkeys("Sb\\\\\", 'tx') + call assert_equal('b', getline('.')) " clean up set omnifunc= -- cgit