Skip to content

Commit d196e30

Browse files
committed
feat: add set_colorscheme helper function
1 parent 50b811c commit d196e30

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/astroui/init.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ function M.setup(opts)
3636
require("astroui.lazygit").setup()
3737
end
3838

39+
--- Set the configured colorscheme
40+
function M.set_colorscheme()
41+
local colorscheme = M.config.colorscheme
42+
if colorscheme and not pcall(vim.cmd.colorscheme, colorscheme) then
43+
require("astrocore").notify(("Error setting up colorscheme: `%s`"):format(colorscheme), vim.log.levels.ERROR)
44+
end
45+
end
46+
3947
--- Get highlight properties for a given highlight name
4048
---@param name string The highlight group name
4149
---@param fallback? table The fallback highlight properties

0 commit comments

Comments
 (0)