From 49a6ed8f32ffd3a770cd916a0546292fca3c0659 Mon Sep 17 00:00:00 2001 From: Kelet Date: Sun, 3 Nov 2013 23:58:10 -0500 Subject: [PATCH] Fix issue 57, and fix file open without close The TextAdept module should now work with TextAdept 7.0. A bug was also fixed regarding the TextAdept plugin where a temporary file wasn't being closed. On Windows, this resulted in an inability to delete the file thus my C:\ directory was being spammed with undeleted temporary files. --- editors/textadept/modules/dmd/dcd.lua | 1 + editors/textadept/modules/dmd/init.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/editors/textadept/modules/dmd/dcd.lua b/editors/textadept/modules/dmd/dcd.lua index 1081b64..0ead9fb 100644 --- a/editors/textadept/modules/dmd/dcd.lua +++ b/editors/textadept/modules/dmd/dcd.lua @@ -123,6 +123,7 @@ function M.autocomplete(ch) p:close() local tmpFile = io.open(fileName, "r") local r = tmpFile:read("*a") + io.close(tmpFile) if r ~= "\n" then if r:match("^identifiers.*") then showCompletionList(r) diff --git a/editors/textadept/modules/dmd/init.lua b/editors/textadept/modules/dmd/init.lua index 3302e79..6978bf2 100644 --- a/editors/textadept/modules/dmd/init.lua +++ b/editors/textadept/modules/dmd/init.lua @@ -20,7 +20,7 @@ local function autocomplete() _M.dcd.registerImages() _M.dcd.autocomplete() if not buffer:auto_c_active() then - _M.textadept.editing.autocomplete_word(keywords) + textadept.editing.autocomplete_word(keywords) end end