Fixed popen mode for windows and non-windows

This commit is contained in:
Hackerpilot 2013-09-07 17:08:51 +00:00
parent 0eac6c8c30
commit d4af3e994a
1 changed files with 5 additions and 1 deletions

View File

@ -113,7 +113,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
local p = io.popen(command, mode)
p:write(buffer:get_text())
p:flush()
p:close()