Skip to content

Commit

Permalink
lua: make sure lpeg is in fact optional
Browse files Browse the repository at this point in the history
fixes #1119: lua: lpeg module isn't actually optional
  • Loading branch information
rnpnr committed Aug 27, 2023
1 parent 0ec372e commit ae450f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/plugins/filetype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
for _, cmd in pairs(filetype.cmd or {}) do
vis:command(cmd)
end
if not vis.lexers.property then return end
local path = vis.lexers.property['lexer.lpeg.home']:gsub(';', '/?.lua;') .. '/?.lua'
local lexpath = package.searchpath('lexers/'..syntax, path)
if lexpath ~= nil then
Expand Down
1 change: 1 addition & 0 deletions lua/vis-std.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ vis:option_register("theme", "string", function(name)
local lexers = vis.lexers
lexers.lexers = {}

if not lexers.load then return false end
if not lexers.property then lexers.load("text") end
local colors = lexers.colors
local default_colors = { "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" }
Expand Down

0 comments on commit ae450f7

Please sign in to comment.