From 90d59e6c8aa6141c54f81586df423e5a76e009f9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 7 Mar 2025 08:18:33 +0800 Subject: vim-patch:9.1.1178: not possible to generate completion candidates using fuzzy matching Problem: not possible to generate completion candidates using fuzzy matching Solution: add the 'completefuzzycollect' option for (some) ins-completion modes (glepnir) fixes vim/vim#15296 fixes vim/vim#15295 fixes vim/vim#15294 closes: vim/vim#16032 https://github.com/vim/vim/commit/f31cfa29bf72b0cdf6fa1b60346ea4e187bcafd1 Co-authored-by: glepnir --- test/functional/ui/popupmenu_spec.lua | 60 +++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 27 deletions(-) (limited to 'test/functional') diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 76673c84b8..9403f39ba1 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -6932,25 +6932,48 @@ describe('builtin popupmenu', function() ]]) feed('o=Comp()') screen:expect_unchanged(true) + feed('') + + command('hi PmenuMatchSel guibg=NONE') + command('hi PmenuMatch guibg=NONE') + command('set cot=menu,noinsert,fuzzy') + feed('S') + screen:expect(pum_start) + feed('fb') + screen:expect([[ + fb^ | + {ms:f}{s:oo}{ms:B}{s:az fookind }{1: }| + {mn:f}{n:oo}{mn:b}{n:ar fookind }{1: }| + {mn:f}{n:oo}{mn:b}{n:ala fookind }{1: }| + {1:~ }|*15 + {2:-- }{5:match 1 of 9} | + ]]) + + feed('') + end) + + it('completefuzzycollect', function() + exec([[ + set completefuzzycollect=keyword,files + set completeopt=menu,menuone + ]]) - feed('') - command('set completeopt+=fuzzy,menu') feed('S hello helio hero h') screen:expect([[ - hello helio hero h^ | - {1:~ }{n: }{mn:h}{n:ero }{1: }| - {1:~ }{n: }{mn:h}{n:elio }{1: }| - {1:~ }{s: }{ms:h}{s:ello }{1: }| + hello helio hero hello^ | + {1:~ }{n: hero }{1: }| + {1:~ }{n: helio }{1: }| + {1:~ }{s: hello }{1: }| {1:~ }|*15 {2:-- }{5:match 1 of 3} | ]]) feed('S hello helio hero h') screen:expect([[ - hello helio hero h^ | - {1:~ }{n: }{mn:h}{n:ero }{1: }| - {1:~ }{s: }{ms:h}{s:elio }{1: }| - {1:~ }{n: }{mn:h}{n:ello }{1: }| + hello helio hero helio^ | + {1:~ }{n: hero }{1: }| + {1:~ }{s: helio }{1: }| + {1:~ }{n: hello }{1: }| {1:~ }|*15 {2:-- }{5:match 2 of 3} | ]]) @@ -6962,23 +6985,6 @@ describe('builtin popupmenu', function() {2:-- }{6:Pattern not found} | ]]) feed('') - - command('hi PmenuMatchSel guibg=NONE') - command('hi PmenuMatch guibg=NONE') - command('set cot=menu,noinsert,fuzzy') - feed('S') - screen:expect(pum_start) - feed('fb') - screen:expect([[ - fb^ | - {ms:f}{s:oo}{ms:B}{s:az fookind }{1: }| - {mn:f}{n:oo}{mn:b}{n:ar fookind }{1: }| - {mn:f}{n:oo}{mn:b}{n:ala fookind }{1: }| - {1:~ }|*15 - {2:-- }{5:match 1 of 9} | - ]]) - - feed('') end) -- oldtest: Test_pum_highlights_match_with_abbr() -- cgit