fix(sql): only use cmp if it is available

This commit is contained in:
Jakob Pfender 2024-11-26 14:08:02 +01:00
parent adcbfc72fd
commit 64c2731046

View file

@ -48,6 +48,7 @@ return {
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = sql_ft, pattern = sql_ft,
callback = function() callback = function()
if LazyVim.has("cmp") then
local cmp = require("cmp") local cmp = require("cmp")
-- global sources -- global sources
@ -61,6 +62,7 @@ return {
-- update sources for the current buffer -- update sources for the current buffer
cmp.setup.buffer({ sources = sources }) cmp.setup.buffer({ sources = sources })
end
end, end,
}) })
end, end,