perf: don't eagerly load vim.snippet (#1896)
Evaluating `vim.snippet` loads many modules, which takes about 1ms.
This commit is contained in:
@@ -29,7 +29,7 @@ return function()
|
|||||||
mapping = {},
|
mapping = {},
|
||||||
|
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = vim.snippet and function(args)
|
expand = vim.fn.has('nvim-0.10') == 1 and function(args)
|
||||||
vim.snippet.expand(args.body)
|
vim.snippet.expand(args.body)
|
||||||
end or function(_)
|
end or function(_)
|
||||||
error('snippet engine is not configured.')
|
error('snippet engine is not configured.')
|
||||||
|
|||||||
Reference in New Issue
Block a user