perf: don't eagerly load vim.snippet (#1896)

Evaluating `vim.snippet` loads many modules, which takes about 1ms.
This commit is contained in:
Jaehwang Jung 2024-04-23 11:00:27 +09:00 committed by GitHub
parent ce16de5665
commit 8f3c541407
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.')