From da49bc368e839a2b7b17a7f29a1491e265ada9e3 Mon Sep 17 00:00:00 2001 From: Jaehwang Jung Date: Sun, 21 Apr 2024 17:41:48 +0900 Subject: [PATCH] perf: don't eagerly load vim.snippet Evaluating `vim.snippet` loads many modules, which takes about 1ms. --- lua/cmp/config/default.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cmp/config/default.lua b/lua/cmp/config/default.lua index 65c0fdacc..37c9befd8 100644 --- a/lua/cmp/config/default.lua +++ b/lua/cmp/config/default.lua @@ -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.')