aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-01-25 22:34:54 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-01-25 22:39:40 +0800
commit689c23b2ac5c8cb5953e45f9f0cf6c369e8d88df (patch)
tree068e140507ac1b722898b93cc485e3e595095c3f /test
parent63aa167f944b147b9d4b8c417a37f4beb212d984 (diff)
downloadrneovim-689c23b2ac5c8cb5953e45f9f0cf6c369e8d88df.tar.gz
rneovim-689c23b2ac5c8cb5953e45f9f0cf6c369e8d88df.tar.bz2
rneovim-689c23b2ac5c8cb5953e45f9f0cf6c369e8d88df.zip
vim-patch:9.1.1053: "nosort" enables fuzzy filtering even if "fuzzy" isn't in 'completeopt'
Problem: "nosort" enables fuzzy filtering even if "fuzzy" isn't in 'completeopt' (after v9.1.1049) Solution: Only enable fuzzy filtering when "fuzzy" is in 'completeopt'. (zeertzjq) closes: vim/vim#16510 https://github.com/vim/vim/commit/d65aa1bbdb808ef8fecde6df240c48cc39a52a8e
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_ins_complete.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim
index 988b7995ed..1c63e8f4cc 100644
--- a/test/old/testdir/test_ins_complete.vim
+++ b/test/old/testdir/test_ins_complete.vim
@@ -2839,8 +2839,8 @@ func Test_complete_fuzzy_match()
" 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.
+ " "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')
@@ -2852,6 +2852,11 @@ func Test_complete_fuzzy_match()
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!