File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -534,7 +534,14 @@ function Snippet:get_completions(prefix)
534
534
535
535
local snippets = self .cache [ft ]
536
536
for trigger , snippet_data in pairs (snippets ) do
537
- if vim .startswith (trigger :lower (), prefix :lower ()) then
537
+ local snippet_prefix = snippet_data .prefix
538
+ if
539
+ vim .startswith (snippet_prefix :lower (), prefix :lower ())
540
+ or (
541
+ vim .o .completeopt :find (' fuzzy' )
542
+ and next (vim .fn .matchfuzzy ({ snippet_prefix }, prefix :lower ())) ~= nil
543
+ )
544
+ then
538
545
local body = snippet_data .body
539
546
local insert_text = body
540
547
@@ -543,8 +550,9 @@ function Snippet:get_completions(prefix)
543
550
end
544
551
545
552
table.insert (results , {
546
- label = trigger ,
553
+ label = snippet_prefix ,
547
554
kind = 15 ,
555
+ filterText = snippet_prefix ,
548
556
insertText = insert_text ,
549
557
documentation = {
550
558
kind = ' markdown' ,
You can’t perform that action at this time.
0 commit comments