Skip to content

Commit

Permalink
fix(extra): remove a issue in the setup function that ignores new the…
Browse files Browse the repository at this point in the history
…me variants
  • Loading branch information
pauchiner committed Feb 14, 2024
1 parent b7f602a commit 13f5903
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lua/pastelnight/extra/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,28 @@ end

function M.setup()
M.docs()
local config = require('pastelnight.config')

local theme = require('pastelnight');
vim.o.background = 'dark'

-- map of style to style name
local styles = {
default = ' Default',
high_contrast = ' High Contrast',
highcontrast = ' High Contrast',
}

for extra, info in pairs(M.extras) do
package.loaded['pastelnight.extra.' .. extra] = nil
local plugin = require('pastelnight.extra.' .. extra)

for style, style_name in pairs(styles) do
---@diagnostic disable-next-line: missing-fields
config.setup({ style = style })
theme.setup({style = style})
theme.load({style = style})
vim.cmd.colorscheme("pastelnight-" .. style)
local colors = require('pastelnight.colors').setup({ transform = true })
local fname = extra .. '/pastelnight_' .. style .. '.' .. info.ext
colors['_upstream_url'] = 'https://github.com/pauchiner/pastelnight.nvim/raw/main/extras/' .. fname
colors['_style_name'] = 'PastelNight' .. style_name
colors["_name"] = "pastelnight_" .. style
write(plugin.generate(colors), fname)
end
end
Expand Down

0 comments on commit 13f5903

Please sign in to comment.