From 039d5fb86fc3c0834ede3b20b9ddf000d79a71b8 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Tue, 29 Mar 2022 20:17:17 +0200 Subject: Fix snippets --- after/plugin/luasnip.lua | 7 +------ lua/alpha/snips/ft/lua.lua | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua index 532307e..65d3dcb 100644 --- a/after/plugin/luasnip.lua +++ b/after/plugin/luasnip.lua @@ -95,16 +95,11 @@ local make = function(tbl) return result end - - -local snippets = {} - for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/alpha/snips/ft/*.lua", true)) do local ft = vim.fn.fnamemodify(ft_path, ":t:r") - snippets[ft] = make(loadfile(ft_path)()) + ls.add_snippets(ft, make(loadfile(ft_path)())) end -ls.snippets = snippets -- is my expansion key -- this will expand the current item or jump to the next item within the snippet. diff --git a/lua/alpha/snips/ft/lua.lua b/lua/alpha/snips/ft/lua.lua index 539751e..3a4fe52 100644 --- a/lua/alpha/snips/ft/lua.lua +++ b/lua/alpha/snips/ft/lua.lua @@ -37,8 +37,7 @@ return { "local ", i(1), " = function(", - i(2), - ")", + i(2), ")", newline " ", i(0), newline "end", -- cgit v1.2.3