From 6aa3d81e79609eecc0adf700f651bd5760bed8cb Mon Sep 17 00:00:00 2001 From: L3MON4D3 Date: Fri, 22 Sep 2023 18:16:17 +0200 Subject: [PATCH] dynamicNode: only update for complete snippet. Should prevent stuff like the entier buffer being copied. --- lua/luasnip/nodes/dynamicNode.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/luasnip/nodes/dynamicNode.lua b/lua/luasnip/nodes/dynamicNode.lua index bdf31a953..03bc50802 100644 --- a/lua/luasnip/nodes/dynamicNode.lua +++ b/lua/luasnip/nodes/dynamicNode.lua @@ -119,6 +119,10 @@ function DynamicNode:update() return end + if not self.parent.snippet:extmarks_valid() then + error("Refusing to update a snippet with invalid extmarks") + end + local tmp if self.snip then if not args then @@ -428,7 +432,10 @@ function DynamicNode:node_at(pos, mode) end function DynamicNode:extmarks_valid() - return node_util.generic_extmarks_valid(self, self.snip) + if self.snip then + return node_util.generic_extmarks_valid(self, self.snip) + end + return true end return {