Skip to content

Commit 8b72ece

Browse files
committed
fix(lualine): correct the transparency colors
1 parent 77c592b commit 8b72ece

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

lua/autocmds.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ autocmd({ "ColorScheme" }, {
6868
vim.cmd([[hi Lualine_c_normal guibg=none]])
6969
vim.cmd([[hi StatusLine guibg=none]])
7070
vim.cmd([[hi StatusLineNC guibg=none]])
71+
vim.cmd([[hi TabLineFill guibg=none]])
7172
end,
7273
})

lua/plugins/configs/lualine.lua

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,18 @@ local conditions = {
2828
}
2929

3030
local auto = require("lualine.themes.auto")
31-
local function make_transparent(theme_table)
32-
for _, sections in pairs(theme_table) do
33-
if type(sections) == "table" then
34-
for _, section_colors in pairs(sections) do
35-
-- Set the background of every section to nil
36-
if type(section_colors) == "table" and section_colors.bg then
37-
section_colors.bg = nil
38-
end
39-
end
31+
-- Apply transparency
32+
for _, mode in ipairs({ "normal", "insert", "visual", "replace", "command", "inactive" }) do
33+
if auto[mode] then
34+
for section, hl in pairs(auto[mode]) do
35+
-- reset to default (use scheme's default fg/bg)
36+
hl.fg = nil
37+
hl.bg = nil
38+
hl.gui = nil
4039
end
4140
end
4241
end
4342

44-
-- Apply transparency
45-
make_transparent(auto)
46-
4743
-- Config
4844
local config = {
4945
options = {

0 commit comments

Comments
 (0)