aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2020-06-05 15:42:48 +0200
committerMatěj Cepl <mcepl@cepl.eu>2020-06-05 15:42:48 +0200
commit872ac619fdf8891869667d9dbd583971a23c9a0b (patch)
treeef5cff84c47805af5dd0c01173a88ed0f2aae381
parent5126dbbeaf47e11d3799b3ce89bede9b97c6b7d6 (diff)
downloadvis-open_rej-872ac619fdf8891869667d9dbd583971a23c9a0b.tar.gz
Don't start plugin on the empty file (running 'vis` without any parameter)
-rw-r--r--init.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 8aaff39..64c3064 100644
--- a/init.lua
+++ b/init.lua
@@ -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