Skip to content

Commit 68d7298

Browse files
committed
feat(cache): auto-generate cache on first load
1 parent bca6544 commit 68d7298

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/cyberdream/cache.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ end
5656
M.load = function()
5757
local cache = io.open(cache_file, "r")
5858
if not cache then
59+
M.build(require("cyberdream.theme").setup())
5960
local notify = vim.defer_fn(function()
60-
util.notify("Cache file not found, run :CyberdreamBuildCache to generate", "warn")
61+
util.notify(" Building cache...\n A restart may be required for changes to take effect.")
62+
M.load()
6163
end, 1000)
6264
return notify
6365
end
6466

6567
local theme = vim.json.decode(cache:read("*a"))
66-
6768
for group, opts in pairs(theme.highlights) do
6869
vim.api.nvim_set_hl(0, group, opts)
6970
end
7071

7172
M.load_options(theme)
72-
7373
vim.g.colors_name = "cyberdream"
7474
end
7575

0 commit comments

Comments
 (0)