diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2020-06-05 15:42:48 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2020-06-05 15:42:48 +0200 |
commit | 872ac619fdf8891869667d9dbd583971a23c9a0b (patch) | |
tree | ef5cff84c47805af5dd0c01173a88ed0f2aae381 | |
parent | 5126dbbeaf47e11d3799b3ce89bede9b97c6b7d6 (diff) | |
download | vis-open_rej-872ac619fdf8891869667d9dbd583971a23c9a0b.tar.gz |
Don't start plugin on the empty file (running 'vis` without any parameter)
-rw-r--r-- | init.lua | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -6,9 +6,11 @@ local function file_exists(path) end local function open_rej_file(file) - local rejfile = file .. '.rej' - if file_exists(rejfile) then - vis:command('open ' .. rejfile) + if file then + local rejfile = file .. '.rej' + if file_exists(rejfile) then + vis:command('open ' .. rejfile) + end end end |