Skip to content

Commit 98d9cb5

Browse files
authored
Merge pull request #65 from aarondill/master
2 parents 05a9ab2 + 7234252 commit 98d9cb5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: lua/cmp_luasnip/init.lua

+4
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function source:complete(params, callback)
8989
label = snip.trigger,
9090
kind = cmp.lsp.CompletionItemKind.Snippet,
9191
data = {
92+
priority = snip.effective_priority or 1000, -- Default priority is used for old luasnip versions
9293
filetype = ft,
9394
snip_id = snip.id,
9495
show_condition = snip.show_condition,
@@ -98,6 +99,9 @@ function source:complete(params, callback)
9899
end
99100
end
100101
end
102+
table.sort(ft_items, function(a, b)
103+
return a.data.priority > b.data.priority
104+
end)
101105
snip_cache[ft] = ft_items
102106
end
103107
vim.list_extend(items, snip_cache[ft])

0 commit comments

Comments
 (0)