aboutsummaryrefslogtreecommitdiffstats
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua11
1 files changed, 1 insertions, 10 deletions
diff --git a/init.lua b/init.lua
index a32f753..7d3dad7 100644
--- a/init.lua
+++ b/init.lua
@@ -1,14 +1,5 @@
local internal_open = false
-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_other_file(file)
local other = ""
if file then
@@ -19,7 +10,7 @@ local function open_other_file(file)
-- open rejected hunks file
other = file .. '.rej'
end
- if file_exists(other) then
+ if vis:file_exists(other) then
internal_open = true
vis:command('open ' .. other)
end