vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit ec3c83bcad05e1a1a59e34bb29f759719c42fc59 parent 4b678beed28d1a4a82a6562b17614462ed363b44 Author: Marc André Tanner <mat@brain-dump.org> Date: Tue, 8 Mar 2016 13:48:32 +0100 vis: handle lexer module load failure even more gracefully Close #197 Diffstat:
| M | visrc.lua | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git 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