From 16afdd9f762fc6cef6a6543a821531c6884a3384 Mon Sep 17 00:00:00 2001 From: pysan3 Date: Tue, 18 Apr 2023 08:06:19 +0900 Subject: [PATCH] deepcopy user defined snippet nodes before expanding --- lua/neorg/modules/external/templates/snippet_handler.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/neorg/modules/external/templates/snippet_handler.lua b/lua/neorg/modules/external/templates/snippet_handler.lua index e605236..3d451f6 100644 --- a/lua/neorg/modules/external/templates/snippet_handler.lua +++ b/lua/neorg/modules/external/templates/snippet_handler.lua @@ -6,6 +6,7 @@ local sn = ls.snippet_node local i = ls.insert_node local d = ls.dynamic_node local fmt = require("luasnip.extras.fmt").fmt +local types = require("luasnip.util.types") local e = function(trig, name, dscr, wordTrig, regTrig, docstring, docTrig, hidden, priority) local ret = { trig = trig, name = name, dscr = dscr } if wordTrig ~= nil then ret["wordTrig"] = wordTrig end @@ -51,7 +52,7 @@ end M.build_keywords = function(kwds_ids) local res = { CURSOR = i(0) } for key, id in pairs(kwds_ids) do - res[key] = sn(id, { M.keywords[key] }) + res[key] = sn(id, { vim.deepcopy(M.keywords[key]) }) end return res end