File: visrc.lua

package info (click to toggle)
vis 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,624 kB
  • sloc: ansic: 23,195; sh: 981; makefile: 363; python: 47
file content (14 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
vis.events = {}
vis.events.win_open = function(win)
	-- test.in file passed to vis
	local in_file = win.file.name
	if in_file then
		-- use the corresponding test.cmd file
		local cmd_file_name = string.gsub(in_file, '%.in$', '.cmd');
		local cmd_file = io.open(cmd_file_name)
		local cmd = cmd_file:read('*all')
		vis:command(string.format(",{\n %s\n }", cmd))
		local out_file_name = string.gsub(in_file, '%.in$', '.vis.out')
		vis:command(string.format("w! %s", out_file_name))
	end
end