aboutsummaryrefslogtreecommitdiff
path: root/modules/lua/commands.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-02-14 16:31:42 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-02-14 16:31:42 -0500
commit754687fd75a226cb5a3a46d92b8c48e589a59a54 (patch)
tree9e2f716a1f90533205d3dacd54606d4a648a01f5 /modules/lua/commands.lua
parent6fc95cc3a1df42d81f24d1a912bcaec952db62d4 (diff)
downloadtextadept-754687fd75a226cb5a3a46d92b8c48e589a59a54.tar.gz
textadept-754687fd75a226cb5a3a46d92b8c48e589a59a54.zip
Read and write in binary mode for everything.
Diffstat (limited to 'modules/lua/commands.lua')
-rw-r--r--modules/lua/commands.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua
index 0b918087..47e872e0 100644
--- a/modules/lua/commands.lua
+++ b/modules/lua/commands.lua
@@ -55,11 +55,10 @@ function goto_required()
end
if not file then return end
file = file:sub(2, -2):gsub('%.', '/')
+ local lfs = require 'lfs'
for path in package.path:gmatch('[^;]+') do
path = path:gsub('?', file)
- local f = io.open(path)
- if f then
- f:close()
+ if lfs.attributes(file) then
textadept.io.open(path)
break
end