Skip to content

Commit

Permalink
fix: options, config
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Cancelinha committed Aug 16, 2024
1 parent 897d666 commit f5f2a27
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
12 changes: 9 additions & 3 deletions lua/nordern/config.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
local C = {}
local colors = require("nordern.colors")

C.default = {
italic_comments = false,
brighter_comments = false,
transparent = false,
}

local function apply_italicized_comments(syntax)
syntax.Comment.italic = true
end
Expand All @@ -13,17 +19,17 @@ local function apply_transparent_background(base)
base.Normal.bg = colors.none
end

function C.apply_opts(highlights, opts)
function C.apply_config(highlights, opts)
if opts then
if opts.italicized_comments then
if opts.italic_comments then
apply_italicized_comments(highlights.syntax)
end

if opts.brighter_comments then
apply_brighter_comments(highlights.syntax)
end

if opts.transparent_background then
if opts.transparent then
apply_transparent_background(highlights.gui)
end
end
Expand Down
22 changes: 13 additions & 9 deletions lua/nordern/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
-- ********************************************************************************
local nordern = {}

local b = require("nordern.base")
local l = require("nordern.lang")
local p = require("nordern.plugs")
local u = require("nordern.utils")
local c = require("nordern.config")
local B = require("nordern.base")
local L = require("nordern.lang")
local P = require("nordern.plugs")
local U = require("nordern.utils")
local C = require("nordern.config")

function nordern.load(opts)
u.preload()
c.config(b, opts)
u.load(b, l, p)
function nordern.setup(opts)
local config = vim.tbl_deep_extend("force", C.default, opts or {})
C.apply_config(B, config)
end

function nordern.load()
U.preload()
U.load(B, L, P)
end

return nordern

0 comments on commit f5f2a27

Please sign in to comment.