Skip to content

Commit

Permalink
feat(utils): add opts to be accessed from hl group callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Lamia authored and mehalter committed Jul 8, 2023
1 parent adaeaa2 commit 64640a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/astrotheme/lib/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ function M.get_plugin_list(opts)
end

function M.get_hl_modules(highlights, path, modules)
local opts = require("astrotheme").config.style
for _, module in ipairs(modules) do
local file_avail, file = pcall(require, path .. "." .. module)
if type(file) == "function" then file = file() end
if type(file) == "function" then file = file(opts) end
if file_avail then highlights = vim.tbl_deep_extend("force", file, highlights) end
end
return highlights
Expand Down

0 comments on commit 64640a8

Please sign in to comment.