refactor(nvim): improve handling of setting cul hls in statuscol

This commit is contained in:
Price Hiller 2024-02-20 17:39:27 -06:00
parent eb98162264
commit 82f65bc4ed
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB

View File

@ -23,10 +23,11 @@ return {
local name = sign.texthl
if name and not sign.culhl then
local hl = vim.api.nvim_get_hl(0, { name = name, link = false })
vim.api.nvim_set_hl(0, name, { fg = hl.fg, bg = bg })
name = name .. "Cul"
vim.api.nvim_set_hl(0, name, { fg = hl.fg, bg = cl_bg })
vim.fn.sign_define(sign.name, { culhl = name })
vim.api.nvim_set_hl(0, name, vim.tbl_deep_extend("force", hl, { bg = bg, force = true }))
local cul_hl_name = name .. "Cul"
vim.api.nvim_set_hl(0, cul_hl_name, vim.tbl_deep_extend("force", hl, { bg = cl_bg, nocombine = true, force = true }))
sign.culhl = cul_hl_name
vim.fn.sign_define(sign.name, sign)
end
end
end)