Skip to content

Commit

Permalink
perf: don't eagerly load vim.snippet
Browse files Browse the repository at this point in the history
Evaluating `vim.snippet` loads many modules, which takes about 1ms.
  • Loading branch information
tomtomjhj committed Apr 21, 2024
1 parent ce16de5 commit da49bc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/cmp/config/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ return function()
mapping = {},

snippet = {
expand = vim.snippet and function(args)
expand = vim.fn.has('nvim-0.10') == 1 and function(args)
vim.snippet.expand(args.body)
end or function(_)
error('snippet engine is not configured.')
Expand Down

0 comments on commit da49bc3

Please sign in to comment.