From f7d6b934b382242ea22d96b672a5705cc2661153 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 7 Jun 2024 21:49:19 +0300 Subject: [PATCH] fix(cmp): don't enable `snippets` source without `nvim-snippets` Make it easier, so if users decide to disable `nvim-snippets`, they don't have to remove the `snippets` source manually in their config. --- lua/lazyvim/plugins/coding.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index cf563f4a..155cfe80 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -111,7 +111,9 @@ return { return LazyVim.cmp.expand(item.body) end, } - table.insert(opts.sources, { name = "snippets" }) + if LazyVim.has("nvim-snippets") then + table.insert(opts.sources, { name = "snippets" }) + end end, keys = { {