File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -532,11 +532,21 @@ function Snippet:get_completions(prefix)
532
532
return results
533
533
end
534
534
535
+ local snippet_prefix_match = function (p )
536
+ for _ , item in ipairs (p ) do
537
+ if vim .startswith (item :lower (), prefix :lower ()) then
538
+ return true
539
+ end
540
+ end
541
+ return false
542
+ end
543
+
535
544
local snippets = self .cache [ft ]
536
545
for trigger , snippet_data in pairs (snippets ) do
537
- local snippet_prefix = snippet_data .prefix
546
+ local snippet_prefix = type (snippet_data .prefix ) == ' string' and { snippet_data .prefix }
547
+ or snippet_data .prefix
538
548
if
539
- vim . startswith ( snippet_prefix : lower (), prefix : lower () )
549
+ snippet_prefix_match ( snippet_data . prefix )
540
550
or (
541
551
vim .o .completeopt :find (' fuzzy' )
542
552
and next (vim .fn .matchfuzzy ({ snippet_prefix }, prefix :lower ())) ~= nil
You can’t perform that action at this time.
0 commit comments