From bc2f22e9e726de23c76f4d368efb17f899477913 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Wed, 24 May 2023 04:23:27 +0200 Subject: [PATCH] Mark `linewrapping` `open_files` table as weak We weren't correctly garbage-collecting `Doc`s, so we had `Highlighter`s stay alive over their due time. --- data/plugins/linewrapping.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/plugins/linewrapping.lua b/data/plugins/linewrapping.lua index e461ae52..62412720 100644 --- a/data/plugins/linewrapping.lua +++ b/data/plugins/linewrapping.lua @@ -310,7 +310,7 @@ local function get_line_col_from_index_and_x(docview, idx, x) end -local open_files = {} +local open_files = setmetatable({ }, { __mode = "k" }) local old_doc_insert = Doc.raw_insert function Doc:raw_insert(line, col, text, undo_stack, time)