aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-03-08 13:48:32 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-03-08 13:48:32 +0100
commit19de55089e69605186a61da633809d75db67b0d5 (patch)
treeca1c8877e67411f2e3b82b4375decd6af40fee9c
parent73dda181924e869b298e026981613734bebdef7b (diff)
downloadvis-19de55089e69605186a61da633809d75db67b0d5.tar.gz
vis-19de55089e69605186a61da633809d75db67b0d5.tar.xz
vis: handle lexer module load failure even more gracefully
Close #197
-rw-r--r--visrc.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/visrc.lua b/visrc.lua
index 3224eb4..48e7205 100644
--- a/visrc.lua
+++ b/visrc.lua
@@ -1,9 +1,10 @@
local ok, msg = pcall(function()
+ vis.lexers = {}
vis.lexers = require('lexer')
end)
if not ok then
- vis:info('WARNING: could not load lexer module')
+ vis:info('WARNING: could not load lexer module, is lpeg installed?')
end
vis.events = {}
@@ -188,7 +189,7 @@ vis.events.win_open = function(win)
if #filename >= #pattern then
local s, e = string.find(filename, pattern, -#pattern, true)
if s ~= e and e == #filename then
- vis:command('set syntax '.. lang)
+ win.syntax = lang
return;
end
end