diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2018-01-22 16:13:09 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2018-01-22 21:50:05 +0100 |
| commit | 5b8042ab1aa986d27e8974dbffe96bda6af61faf (patch) | |
| tree | bf391f6c5bbb89a05ba35b73f64b7abb914d3156 /lua/plugins | |
| parent | a94b52f7970ea5e6aa68fc5f5aa6c7de7884c7c7 (diff) | |
| download | vis-5b8042ab1aa986d27e8974dbffe96bda6af61faf.tar.gz vis-5b8042ab1aa986d27e8974dbffe96bda6af61faf.tar.xz | |
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.
Diffstat (limited to 'lua/plugins')
| -rw-r--r-- | lua/plugins/number-inc-dec.lua | 2 | ||||
| -rw-r--r-- | lua/plugins/textobject-lexer.lua | 2 |
2 files changed, 2 insertions, 2 deletions
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 |
