From 689c23b2ac5c8cb5953e45f9f0cf6c369e8d88df Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 25 Jan 2025 22:34:54 +0800 Subject: 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 --- test/old/testdir/test_ins_complete.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test') 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\\fb", 'tx') call assert_equal('foobar', g:word) call feedkeys("S\\好", 'tx') @@ -2852,6 +2852,11 @@ func Test_complete_fuzzy_match() call feedkeys("S\\好\", '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\\fooB\", 'tx') + call assert_equal('fooBaz', getline('.')) + " clean up set omnifunc= bw! -- cgit