minor fixes

v2.5
siduck 4 years ago
parent 45421bc921
commit 896a4a9271

@ -23,14 +23,13 @@ if polish_hl then
end
-- override user highlights if there are any
if ui.hl_override then
local user_highlights = ui.hl_override
local colors = require("base46").get_theme_tb "base_30"
local user_highlights = ui.hl_override
local colors = require("base46").get_theme_tb "base_30"
-- fg = "white" set by user becomes fg = colors["white"]
-- so no need for the user to import colors
-- fg = "white" set by user becomes fg = colors["white"]
-- so no need for the user to import colors
for group, _ in pairs(user_highlights) do
for group, _ in pairs(user_highlights) do
for key, val in pairs(user_highlights[group]) do
if key == "fg" or key == "bg" then
if val:sub(1, 1) == "#" or val == "none" or val == "NONE" then
@ -40,11 +39,10 @@ if ui.hl_override then
end
end
end
end
highlights = merge_tb(highlights, user_highlights)
end
highlights = merge_tb(highlights, user_highlights)
-- local set_transparent = nvchad.load_config().ui.transparency
if vim.g.transparency then
highlights = merge_tb(highlights, require "base46.glassy")

@ -39,10 +39,9 @@ end
M.load_all_highlights = function()
-- reload highlights for theme switcher
local reload = require("plenary.reload").reload_module
local clear_hl = require("base46").clear_highlights
clear_hl "BufferLine"
clear_hl "TS"
M.clear_highlights "BufferLine"
M.clear_highlights "TS"
reload "base46.integrations"
reload "base46.chadlights"
@ -54,21 +53,64 @@ M.load_all_highlights = function()
end
end
M.load_highlight = function(group)
local default_hl = require("base46.integrations." .. group)
local user_hl = config.ui.hl_override
M.turn_str_to_color = function(tb)
local colors = M.get_theme_tb "base_30"
for _, groups in pairs(tb) do
for k, v in pairs(groups) do
if k == "fg" or k == "bg" then
if v:sub(1, 1) == "#" or v == "none" or v == "NONE" then
else
groups[k] = colors[v]
end
end
end
end
return tb
end
M.extend_default_hl = function(highlights)
local glassy = require "base46.glassy"
local polish_hl = M.get_theme_tb "polish_hl"
if polish_hl then
-- polish themes
for key, value in pairs(polish_hl) do
if highlights[key] then
highlights[key] = value
end
end
end
-- transparency
if vim.g.transparency then
user_hl = M.merge_tb(user_hl, require "base46.glassy")
-- highlights_tb = M.merge_tb(highlights_tb,)
for key, value in pairs(glassy) do
if highlights[key] then
highlights[key] = value
end
end
end
local overriden_hl = M.turn_str_to_color(config.ui.hl_override)
for key, value in pairs(user_hl) do
if default_hl[key] then
default_hl[key] = value
for key, value in pairs(overriden_hl) do
if highlights[key] then
highlights[key] = value
end
end
end
M.load_highlight = function(group)
if type(group) == "string" then
group = require("base46.integrations." .. group)
M.extend_default_hl(group)
else
group = group
end
for hl, col in pairs(default_hl) do
for hl, col in pairs(group) do
vim.api.nvim_set_hl(0, hl, col)
end
end
@ -80,6 +122,7 @@ M.load_theme = function()
M.load_highlight "defaults"
M.load_highlight "statusline"
M.load_highlight(M.turn_str_to_color(config.ui.hl_add))
end
M.override_theme = function(default_theme, theme_name)

@ -32,6 +32,10 @@ return {
fg = theme.base09,
},
Variable = {
fg = theme.base05,
},
Function = {
fg = theme.base0D,
},

@ -41,6 +41,16 @@ return {
sp = "none",
},
TSKeywordFunction = {
fg = theme.base0E,
sp = "none",
},
TSKeywordReturn = {
fg = theme.base0E,
sp = "none",
},
TSFuncBuiltin = {
fg = theme.base0D,
sp = "none",
@ -152,6 +162,10 @@ return {
sp = "none",
},
TSVariable = {
fg = theme.base05,
},
TSDefinition = {
sp = theme.base04,
underline = true,

@ -17,6 +17,7 @@ M.base_30 = {
pink = "#bb7cb6",
line = "#2e2e2e", -- for lines like vertsplit
green = "#B5CEA8",
green1 = "#4EC994",
vibrant_green = "#bfd8b2",
blue = "#569CD6",
nord_blue = "#60a6e0",
@ -24,7 +25,7 @@ M.base_30 = {
sun = "#e1c487",
purple = "#c68aee",
dark_purple = "#b77bdf",
teal = "#4EC994",
teal = "#4294D6",
orange = "#d3967d",
cyan = "#9CDCFE",
statusline_bg = "#242424",
@ -50,10 +51,13 @@ M.base_16 = {
base0C = "#9CDCFE",
base0D = "#DCDCAA",
base0E = "#C586C0",
base0F = "#CE9178",
base0F = "#E9E9E9",
}
M.polish_hl = {
TSParameter = {
fg = M.base_30.blue,
},
TSKeyword = {
fg = M.base_30.blue,
@ -64,16 +68,20 @@ M.polish_hl = {
},
luaTSField = {
fg = M.base_30.red,
fg = M.base_30.teal,
},
TSFieldKey = {
fg = M.base_30.teal,
fg = M.base_30.green1,
},
TSKeywordReturn = {
fg = M.base_16.base0E,
},
TSKeywordFunction = {
fg = M.base_30.teal,
},
}
M.type = "dark"

Loading…
Cancel
Save