Skip to content

Commit 103ea1f

Browse files
committed
fix(utils): hl-Statusline retrieval issue in toggleterm
1 parent 8ab099c commit 103ea1f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/modules/utils/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ function M.hl_to_rgb(hl_group, use_bg, fallback_hl)
147147
local hlexists = pcall(vim.api.nvim_get_hl, 0, { name = hl_group, link = false })
148148

149149
if hlexists then
150-
local result = vim.api.nvim_get_hl(0, { name = hl_group, link = false })
150+
-- FIXME: Investigate why hl-StatusLine is undefined in toggleterm and remove this workaround
151+
-- (@Jint-lzxy)
152+
local link = vim.bo.filetype == "toggleterm"
153+
local result = vim.api.nvim_get_hl(0, { name = hl_group, link = link })
151154
if use_bg then
152155
hex = result.bg and string.format("#%06x", result.bg) or "NONE"
153156
else

0 commit comments

Comments
 (0)