aboutsummaryrefslogblamecommitdiffstats
path: root/init.lua
blob: 8aaff3967f53829eb388a2485b509610f592f4dc (plain) (tree)
1
2
3
4
5
6
7
8
9




                                     

   
                                  
                                  
                                
                                       





                                                          
 
local function file_exists(path)
	local f = io.open(path)
	if f == nil then return false
	else f:close() return true
	end
end

local function open_rej_file(file)
    local rejfile = file .. '.rej'
    if file_exists(rejfile) then
        vis:command('open ' .. rejfile)
    end
end

vis.events.subscribe(vis.events.FILE_OPEN, function (file)
  open_rej_file(file.path)
end)