aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init.lua16
1 files changed, 7 insertions, 9 deletions
diff --git a/init.lua b/init.lua
index d94b8e9..8aaff39 100644
--- a/init.lua
+++ b/init.lua
@@ -1,14 +1,11 @@
-function file_exists(name)
- local f=io.open(name,"r")
- if f~=nil then
- io.close(f)
- return true
- else
- return false
- end
+local function file_exists(path)
+ local f = io.open(path)
+ if f == nil then return false
+ else f:close() return true
+ end
end
-function open_rej_file(file)
+local function open_rej_file(file)
local rejfile = file .. '.rej'
if file_exists(rejfile) then
vis:command('open ' .. rejfile)
@@ -18,3 +15,4 @@ end
vis.events.subscribe(vis.events.FILE_OPEN, function (file)
open_rej_file(file.path)
end)
+