Compare commits

..

2 Commits

Author SHA1 Message Date
d6dfbe4659 chore(notify): silence missing bg hl warning 2025-03-08 21:20:11 +01:00
4f11874437 chore: cleanup and format style changes 2025-03-08 13:59:28 +01:00
8 changed files with 19 additions and 10 deletions

View File

@@ -17,6 +17,8 @@ local M = {
---@param user_cfg Config ---@param user_cfg Config
---@return Config ---@return Config
function M.make_config(user_cfg) return user_cfg and vim.tbl_extend("force", M.default, user_cfg) or M.default end function M.make_config(user_cfg)
return user_cfg and vim.tbl_extend("force", M.default, user_cfg) or M.default
end
return M return M

View File

@@ -2,21 +2,26 @@
---@param palette Palette ---@param palette Palette
return function(theme, palette) return function(theme, palette)
return { return {
NotifyBackground = { link = "Normal" },
NotifyERRORBorder = theme.msg.error, NotifyERRORBorder = theme.msg.error,
NotifyWARNBorder = theme.msg.warning, NotifyWARNBorder = theme.msg.warning,
NotifyINFOBorder = theme.msg.info, NotifyINFOBorder = theme.msg.info,
NotifyDEBUGBorder = theme.msg.hint, NotifyDEBUGBorder = theme.msg.hint,
NotifyTRACEBorder = theme.msg.error, NotifyTRACEBorder = theme.msg.error,
NotifyERRORIcon = { link = "NotifyERRORBorder" }, NotifyERRORIcon = { link = "NotifyERRORBorder" },
NotifyWARNIcon = { link = "NotifyWARNBorder" }, NotifyWARNIcon = { link = "NotifyWARNBorder" },
NotifyINFOIcon = { link = "NotifyINFOBorder" }, NotifyINFOIcon = { link = "NotifyINFOBorder" },
NotifyDEBUGIcon = { link = "NotifyDEBUGBorder" }, NotifyDEBUGIcon = { link = "NotifyDEBUGBorder" },
NotifyTRACEIcon = { link = "NotifyTRACEBorder" }, NotifyTRACEIcon = { link = "NotifyTRACEBorder" },
NotifyERRORTitle = { link = "NotifyERRORBorder" }, NotifyERRORTitle = { link = "NotifyERRORBorder" },
NotifyWARNTitle = { link = "NotifyWARNBorder" }, NotifyWARNTitle = { link = "NotifyWARNBorder" },
NotifyINFOTitle = { link = "NotifyINFOBorder" }, NotifyINFOTitle = { link = "NotifyINFOBorder" },
NotifyDEBUGTitle = { link = "NotifyDEBUGBorder" }, NotifyDEBUGTitle = { link = "NotifyDEBUGBorder" },
NotifyTRACETitle = { link = "NotifyTRACEBorder" }, NotifyTRACETitle = { link = "NotifyTRACEBorder" },
NotifyERRORBody = { link = "Normal" }, NotifyERRORBody = { link = "Normal" },
NotifyWARNBody = { link = "Normal" }, NotifyWARNBody = { link = "Normal" },
NotifyINFOBody = { link = "Normal" }, NotifyINFOBody = { link = "Normal" },

View File

@@ -142,15 +142,16 @@ return function(theme, palette)
["@lsp.type.string"] = { link = "@string" }, ["@lsp.type.string"] = { link = "@string" },
["@lsp.type.struct"] = { link = "@struct" }, ["@lsp.type.struct"] = { link = "@struct" },
["@lsp.type.typeParameter"] = { link = "@type" }, ["@lsp.type.typeParameter"] = { link = "@type" },
["@lsp.type.unresolvedReference"] = { fg = palette.purple },
["@lsp.type.variable"] = { link = "@variable" }, ["@lsp.type.variable"] = { link = "@variable" },
["@lsp.typemod.class.constructorOrDestructor"] = { link = "@constructor" }, ["@lsp.typemod.class.constructorOrDestructor"] = { link = "@constructor" },
["@lsp.typemod.comment.documentation"] = { link = "@comment.documentation" }, ["@lsp.typemod.comment.documentation"] = { link = "@comment.documentation" },
["@lsp.typemod.const.constant"] = { link = "Constant" },
["@lsp.typemod.constParameter.constant"] = { link = "Constant" },
["@lsp.typemod.derive.attribute"] = { fg = palette.blue }, ["@lsp.typemod.derive.attribute"] = { fg = palette.blue },
["@lsp.typemod.method"] = { link = "@method" }, ["@lsp.typemod.method"] = { link = "@method" },
["@lsp.typemod.selfKeyword"] = theme.highlight_bold, ["@lsp.typemod.selfKeyword"] = theme.highlight_bold,
["@lsp.typemod.string.attribute"] = { link = "String" }, -- Hmmmm ["@lsp.typemod.string.attribute"] = { link = "String" },
["@lsp.typemod.variable.readonly"] = { link = "Constant" }, ["@lsp.typemod.variable.readonly"] = { link = "Constant" },
["@lsp.typemod.const.constant"] = { link = "Constant" },
["@lsp.typemod.constParameter.constant"] = { link = "Constant" },
} }
end end

View File

@@ -18,7 +18,9 @@ local M = {
function M.setup(user_cfg) function M.setup(user_cfg)
M.cfg = config.make_config(user_cfg) M.cfg = config.make_config(user_cfg)
-- If the colors are set, assume we're reloading and auto apply -- If the colors are set, assume we're reloading and auto apply
if vim.g.colors_name == "astrobox" then vim.cmd.colorscheme("astrobox") end if vim.g.colors_name == "astrobox" then
vim.cmd.colorscheme("astrobox")
end
end end
function M.set_highlights(list) function M.set_highlights(list)

View File

@@ -132,7 +132,6 @@ return {
}, },
}, },
-- untested
-- 0.6 with exceptions -- 0.6 with exceptions
light = { light = {
--- @type Colors --- @type Colors

View File

@@ -12,8 +12,6 @@
local colors = require("astrobox.palette.colors") local colors = require("astrobox.palette.colors")
-- TODO Split into palette and theme (float, bars)?
--- @return Palette --- @return Palette
return function(config) return function(config)
local vimbg = vim.o.background local vimbg = vim.o.background

View File

@@ -20,7 +20,9 @@ function M.visit_astrobox_modules(module, visitor)
end end
while true do while true do
local entry, type = vim.loop.fs_scandir_next(hdl) local entry, type = vim.loop.fs_scandir_next(hdl)
if entry == nil then break end if entry == nil then
break
end
if type == "file" and vim.endswith(entry, ".lua") then if type == "file" and vim.endswith(entry, ".lua") then
local mod_name = entry:sub(0, -5) -- cut extension local mod_name = entry:sub(0, -5) -- cut extension
local ok, mod = pcall(require, "astrobox." .. module .. "." .. mod_name) local ok, mod = pcall(require, "astrobox." .. module .. "." .. mod_name)

View File

@@ -2,7 +2,7 @@ column_width = 120
line_endings = "Unix" line_endings = "Unix"
indent_type = "Spaces" indent_type = "Spaces"
call_parentheses = "Always" call_parentheses = "Always"
collapse_simple_statement = "Always" collapse_simple_statement = "Never"
[sort_requires] [sort_requires]
enabled = true enabled = true