Skip to content

Commit

Permalink
deepcopy user defined snippet nodes before expanding
Browse files Browse the repository at this point in the history
  • Loading branch information
pysan3 committed Apr 17, 2023
1 parent 55f5a76 commit 16afdd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/neorg/modules/external/templates/snippet_handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 16afdd9

Please sign in to comment.