From af80811be01f5349544a1b21e9dd03f0e25fefca Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 8 Jun 2024 00:12:59 +0300 Subject: [PATCH] fix(cmp): don't enable `snippets` source without `nvim-snippets` (#3527) 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 = { {