stylua no special config;

This commit is contained in:
Barrett Ruth 2025-09-11 23:59:02 -05:00
parent 35f8727b85
commit 0636757839
7 changed files with 262 additions and 309 deletions

View file

@ -1,24 +1,24 @@
local M = {}
function M.setup(config)
local has_luasnip, luasnip = pcall(require, 'luasnip')
if not has_luasnip then
return
end
local has_luasnip, luasnip = pcall(require, "luasnip")
if not has_luasnip then
return
end
local snippets = {}
local snippets = {}
for name, snippet in pairs(config.snippets or {}) do
if type(snippet) == 'table' and snippet.trig then
table.insert(snippets, snippet)
else
table.insert(snippets, snippet)
end
end
for name, snippet in pairs(config.snippets or {}) do
if type(snippet) == "table" and snippet.trig then
table.insert(snippets, snippet)
else
table.insert(snippets, snippet)
end
end
if #snippets > 0 then
luasnip.add_snippets('cpp', snippets)
end
if #snippets > 0 then
luasnip.add_snippets("cpp", snippets)
end
end
return M