diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-01-25 22:57:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-25 22:57:59 +0800 |
commit | fb1740521aad48ba7ebd797042d869e3d649b91a (patch) | |
tree | 068e140507ac1b722898b93cc485e3e595095c3f /test/old | |
parent | 851137f67905f6038e51b5b7d1490fbedea4faaa (diff) | |
parent | 689c23b2ac5c8cb5953e45f9f0cf6c369e8d88df (diff) | |
download | rneovim-fb1740521aad48ba7ebd797042d869e3d649b91a.tar.gz rneovim-fb1740521aad48ba7ebd797042d869e3d649b91a.tar.bz2 rneovim-fb1740521aad48ba7ebd797042d869e3d649b91a.zip |
Merge pull request #32204 from zeertzjq/vim-9.1.1049
vim-patch:9.1.{1049,1053}: 'completeopt' "nosort"
Diffstat (limited to 'test/old')
-rw-r--r-- | test/old/testdir/test_ins_complete.vim | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim index f1ff45ff90..1c63e8f4cc 100644 --- a/test/old/testdir/test_ins_complete.vim +++ b/test/old/testdir/test_ins_complete.vim @@ -2778,7 +2778,7 @@ func Test_complete_fuzzy_match() if a:findstart return col(".") endif - return [#{word: "foo"}, #{word: "foobar"}, #{word: "fooBaz"}, #{word: "foobala"}] + return [#{word: "foo"}, #{word: "foobar"}, #{word: "fooBaz"}, #{word: "foobala"}, #{word: "你好吗"}, #{word: "我好"}] endfunc new @@ -2837,6 +2837,26 @@ func Test_complete_fuzzy_match() call feedkeys("STe\<C-X>\<C-N>x\<CR>\<Esc>0", 'tx!') call assert_equal('Tex', getline('.')) + " test case for nosort option + set cot=menuone,menu,noinsert,fuzzy,nosort + " "fooBaz" should have a higher score when the leader is "fb". + " With "nosort", "foobar" should still be shown first in the popup menu. + call feedkeys("S\<C-x>\<C-o>fb", 'tx') + call assert_equal('foobar', g:word) + call feedkeys("S\<C-x>\<C-o>好", 'tx') + call assert_equal("你好吗", g:word) + + set cot+=noselect + call feedkeys("S\<C-x>\<C-o>好", 'tx') + call assert_equal(v:null, g:word) + call feedkeys("S\<C-x>\<C-o>好\<C-N>", 'tx') + call assert_equal('你好吗', g:word) + + " "nosort" shouldn't enable fuzzy filtering when "fuzzy" isn't present. + set cot=menuone,noinsert,nosort + call feedkeys("S\<C-x>\<C-o>fooB\<C-Y>", 'tx') + call assert_equal('fooBaz', getline('.')) + " clean up set omnifunc= bw! |