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


                            
           
                  

   
                                  
                    




                                                       


                                                          
                                
    
 
local function file_exists(path)
	local f = io.open(path)
	local out = f ~= nil
	if out then
		io.close(f)
	end
	return out
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
end

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