From 3c20163456270d032e3e3418b2255b0975e6e093 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sun, 1 Sep 2013 14:22:31 +0000 Subject: [PATCH] "w" is needed on POSIX, but "wb" is needed on Windows. --- editors/textadept/modules/dmd/dcd.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editors/textadept/modules/dmd/dcd.lua b/editors/textadept/modules/dmd/dcd.lua index 3ed6f29..4161a4a 100644 --- a/editors/textadept/modules/dmd/dcd.lua +++ b/editors/textadept/modules/dmd/dcd.lua @@ -111,7 +111,11 @@ function M.autocomplete(ch) if buffer:get_lexer() ~= "dmd" then return end local fileName = os.tmpname() local command = M.PATH_TO_DCD_CLIENT .. " -c" .. buffer.current_pos .. " > " .. fileName - local p = io.popen(command, "wb") + local mode = "w" + if _G.WIN32 then + mode = "wb" + end + p = io.popen(command, mode) p:write(buffer:get_text()) p:flush() p:close()