Skip to content

Commit

Permalink
feat(theme): add a _load function on the init to load different variants
Browse files Browse the repository at this point in the history
  • Loading branch information
pauchiner committed Feb 14, 2024
1 parent c780324 commit 7fc58d5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lua/pastelnight/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ local config = require('pastelnight.config')

local M = {}

function M._load(style)
if style and not M._style then
M._style = require("pastelnight.config").options.style
end
if not style and M._style then
---@diagnostic disable-next-line: inject-field
require("pastelnight.config").options.style = M._style
M._style = nil
end
M.load({ style = style, use_background = style == nil })
end

---@param opts Config|nil
function M.load(opts)
if opts then
Expand Down

0 comments on commit 7fc58d5

Please sign in to comment.