diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 7b180a64e4..50b1834691 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -3387,4 +3387,33 @@ func Test_complete_multiline_marks() delfunc Omni_test endfunc +func Test_complete_append_selected_match_default() + " when typing a normal character during completion, + " completion is ended, see + " :h popupmenu-completion ("There are three states:") + func PrintMenuWords() + let info = complete_info(["selected", "matches"]) + call map(info.matches, {_, v -> v.word}) + return info + endfunc + + new + call setline(1, ["fo", "foo", "foobar", "fobarbaz"]) + exe "normal! Gof\\=PrintMenuWords()\" + call assert_equal('fo{''matches'': [''fo'', ''foo'', ''foobar'', ''fobarbaz''], ''selected'': 0}', getline(5)) + %d + call setline(1, ["fo", "foo", "foobar", "fobarbaz"]) + exe "normal! Gof\o\=PrintMenuWords()\" + call assert_equal('foo{''matches'': [], ''selected'': -1}', getline(5)) + %d + set completeopt=menu,noselect + call setline(1, ["fo", "foo", "foobar", "fobarbaz"]) + exe "normal! Gof\\o\=PrintMenuWords()\" + call assert_equal('foo{''matches'': [], ''selected'': -1}', getline(5)) + bw! + + set completeopt& + delfunc PrintMenuWords +endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/src/version.c b/src/version.c index 67affb2e18..50632747be 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 */ +/**/ + 1265, /**/ 1264, /**/