aboutsummaryrefslogtreecommitdiffstats
path: root/init.lua
blob: da7046463c4cad4c63c086e59de84d26df4b1b95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local function file_exists(path)
	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
end

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