diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -1,20 +1,18 @@ local function file_exists(path) - local f = io.open(path) - if f == nil then return false - else f:close() return true - end + local f <close> = io.open(path) + return f ~= nil end local function open_rej_file(file) if file then - local rejfile = file .. '.rej' - if file_exists(rejfile) then - vis:command('open ' .. rejfile) - end - end + local rejfile = file .. '.rej' + if file_exists(rejfile) then + vis:command('open ' .. rejfile) + end + end end vis.events.subscribe(vis.events.FILE_OPEN, function (file) - open_rej_file(file.path) + open_rej_file(file.path) end) |