diff options
Diffstat (limited to 'lua/vis.lua')
| -rw-r--r-- | lua/vis.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/vis.lua b/lua/vis.lua index 870fc52..479d1ee 100644 --- a/lua/vis.lua +++ b/lua/vis.lua @@ -113,6 +113,8 @@ vis.module_exist = function(vis, name) return false end +vis.lexers = {} + if not vis:module_exist('lpeg') then vis:info('WARNING: could not find lpeg module') elseif not vis:module_exist('lexer') then @@ -235,7 +237,6 @@ vis.events = events vis.types.window.set_syntax = function(win, syntax) local lexers = vis.lexers - if not lexers then return false end win:style_define(win.STYLE_DEFAULT, lexers.STYLE_DEFAULT or '') win:style_define(win.STYLE_CURSOR, lexers.STYLE_CURSOR or '') @@ -256,6 +257,7 @@ vis.types.window.set_syntax = function(win, syntax) return true end + if not lexers.load then return false end local lexer = lexers.load(syntax) if not lexer then return false end |
