Skip to content

Commit

Permalink
feat(extras): add lua to extras
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Jul 12, 2024
1 parent ef80570 commit eb0d508
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/astrotheme/extras/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ local M = {}
-- stylua: ignore
M.extras = {
-- Keep all entries here aligned by the first `=` sign
wezterm = { ext = "toml", url = "https://wezfurlong.org/wezterm/config/files.html", label = "WezTerm" },
lua = { ext = "lua", url = "https://www.lua.org", label = "Lua Table for testing" },
vim = { ext = "vim", url = "https://vimhelp.org/", label = "Vim", subdir = "colors"},
wezterm = { ext = "toml", url = "https://wezfurlong.org/wezterm/config/files.html", label = "WezTerm" },
}

function M.setup()
Expand Down
18 changes: 18 additions & 0 deletions lua/astrotheme/extras/lua.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local M = {}

--- @param colors AstroThemePalette
--- @param highlights table<string, vim.api.keyset.highlight>
function M.generate(colors, highlights)
colors = vim.deepcopy(colors)
colors._upstream_url = nil
colors._style_name = nil

local ret = "local colors = "
.. vim.inspect(colors)
.. "\n\nlocal highlights = "
.. vim.inspect(vim.deepcopy(highlights, true))
.. "\n"
return ret
end

return M

0 comments on commit eb0d508

Please sign in to comment.