diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2024-09-25 13:24:41 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-09-25 13:24:41 +0200 |
commit | 71ed2fb71d6e426ea7c0265eb27eecf520a2d04e (patch) | |
tree | 09b46bcc5e8d13e3907042d8b36ac25990b45b58 /init.lua | |
parent | bd714ef8371c84689ea99717a04dbb1f076ed367 (diff) | |
download | vis-open_rej-master.tar.gz |
Depends on https://git.sr.ht/~mcepl/vis/log/vis-file_exists
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -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 |