diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -1,14 +1,11 @@ -function file_exists(name) - local f=io.open(name,"r") - if f~=nil then - io.close(f) - return true - else - return false - end +local function file_exists(path) + local f = io.open(path) + if f == nil then return false + else f:close() return true + end end -function open_rej_file(file) +local function open_rej_file(file) local rejfile = file .. '.rej' if file_exists(rejfile) then vis:command('open ' .. rejfile) @@ -18,3 +15,4 @@ end vis.events.subscribe(vis.events.FILE_OPEN, function (file) open_rej_file(file.path) end) + |