From 19de55089e69605186a61da633809d75db67b0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 8 Mar 2016 13:48:32 +0100 Subject: vis: handle lexer module load failure even more gracefully Close #197 --- visrc.lua | 5 +++-- 1 file 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 -- cgit v1.2.3