From 5b8042ab1aa986d27e8974dbffe96bda6af61faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 22 Jan 2018 16:13:09 +0100 Subject: lua: fix theme loading when lexer module is not available The color settings are currently stored in the `vis.lexers` table, make sure it is not nil even when loading the lexer module (or one of its dependencies e.g. lpeg) failed. --- lua/plugins/number-inc-dec.lua | 2 +- lua/plugins/textobject-lexer.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lua/plugins') diff --git a/lua/plugins/number-inc-dec.lua b/lua/plugins/number-inc-dec.lua index 26a8825..ca794ca 100644 --- a/lua/plugins/number-inc-dec.lua +++ b/lua/plugins/number-inc-dec.lua @@ -1,7 +1,7 @@ -- increment/decrement number in dec/hex/oct format local lexer = vis.lexers local lpeg = vis.lpeg -if not lexer or not lpeg then return end +if not lexer.load or not lpeg then return end local Cp = lpeg.Cp() local dec_num = lpeg.S('+-')^-1 * lexer.dec_num diff --git a/lua/plugins/textobject-lexer.lua b/lua/plugins/textobject-lexer.lua index fc4876b..2f9d757 100644 --- a/lua/plugins/textobject-lexer.lua +++ b/lua/plugins/textobject-lexer.lua @@ -4,7 +4,7 @@ local MAX_CONTEXT = 32768 vis:textobject_new("ii", function(win, pos) - if win.syntax == nil or not vis.lexers then + if not win.syntax or not vis.lexers.load then return nil end -- cgit v1.2.3