Skip to content

Commit b7a6037

Browse files
committed
fix(lualine): resolve background color defaulting issue
1 parent b8d974a commit b7a6037

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lua/modules/configs/ui/lualine.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,10 @@ return function()
9898
if has_catppuccin then
9999
return function()
100100
local guifg = colors[fg]
101-
local guibg = gen_bg and require("modules.utils").hl_to_rgb("StatusLine", true, colors.mantle)
102-
or colors[bg]
103101
local nobg = special_nobg and require("core.settings").transparent_background
104102
return {
105103
fg = guifg and guifg or colors.none,
106-
bg = (guibg and not nobg) and guibg or colors.none,
104+
bg = nobg and colors.none or ((not gen_bg and colors[bg]) or nil),
107105
gui = gui and gui or nil,
108106
}
109107
end

lua/modules/utils/init.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,7 @@ function M.hl_to_rgb(hl_group, use_bg, fallback_hl)
162162
local hlexists = pcall(vim.api.nvim_get_hl, 0, { name = hl_group, link = false })
163163

164164
if hlexists then
165-
-- FIXME: Investigate why hl-StatusLine is undefined in toggleterm and remove this workaround
166-
-- (@Jint-lzxy)
167-
local link = vim.bo.filetype == "toggleterm"
168-
local result = vim.api.nvim_get_hl(0, { name = hl_group, link = link })
165+
local result = vim.api.nvim_get_hl(0, { name = hl_group, link = false })
169166
if use_bg then
170167
hex = result.bg and string.format("#%06x", result.bg) or "NONE"
171168
else

0 commit comments

Comments
 (0)