refactor(nvim): abandon culhl entirely
All checks were successful
Check Formatting of Files / Check-Formatting (push) Successful in 40s

https://www.youtube.com/watch?v=7Sq6ookE6nA
This commit is contained in:
Price Hiller 2024-03-19 17:56:58 -05:00
parent faa997a6e3
commit 8ee2fb5a7d
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB
3 changed files with 13 additions and 52 deletions

View File

@ -1,4 +1,14 @@
return { return {
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
current_line_blame = true,
current_line_blame_opts = {
delay = 0,
},
},
},
{ {
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
keys = { keys = {

View File

@ -54,14 +54,9 @@ return {
{ "WinBarNC", { bg = nil } }, { "WinBarNC", { bg = nil } },
{ "Visual", { bg = colors.sumiInk5 } }, { "Visual", { bg = colors.sumiInk5 } },
{ "CursorLine", { bg = colors.sumiInk4 } }, { "CursorLine", { bg = colors.sumiInk4 } },
{ "CursorLineNr", { fg = colors.roninYellow, bg = palette.theme.ui.bg_m1 } }, { "CursorLineNr", { fg = colors.roninYellow } },
{ "CursorLineFold", { fg = colors.crystalBlue, bg = palette.theme.ui.bg_m1 } }, { "CursorLineFold", { fg = colors.crystalBlue } },
{ "CursorLineSign", { bg = palette.theme.ui.bg_m1 } }, { "LightBulbSign", { fg = colors.crystalBlue } },
{ "DiagnosticSignErrorCul", { fg = palette.theme.diag.error, bg = palette.theme.ui.bg_m1 } },
{ "DiagnosticSignWarnCul", { fg = palette.theme.diag.warning, bg = palette.theme.ui.bg_m1 } },
{ "DiagnosticSignInfoCul", { fg = palette.theme.diag.info, bg = palette.theme.ui.bg_m1 } },
{ "DiagnosticSignHintCul", { fg = palette.theme.diag.hint, bg = palette.theme.ui.bg_m1 } },
{ "LightBulbSign", { fg = colors.crystalBlue, bg = palette.theme.ui.bg_m1 } },
{ "WinSeparator", { fg = colors.fujiGray } }, { "WinSeparator", { fg = colors.fujiGray } },
{ "StatusLine", { fg = colors.fujiWhite, bg = colors.sumiInk0 } }, { "StatusLine", { fg = colors.fujiWhite, bg = colors.sumiInk0 } },
{ "WinBar", { link = "StatusLine" } }, { "WinBar", { link = "StatusLine" } },

View File

@ -24,38 +24,6 @@ return {
end, end,
}) })
-- HACK: Ensure all signs get the correct CursorLineSign set to their "culhl" value
-- This, in effect, extends the CursorLine background highlight into the signcolumn
vim.uv.new_timer():start(
100,
100,
vim.schedule_wrap(function()
-- Make all signs support "CusorLine.*" highlights
local signs_defined = vim.fn.sign_getdefined() or {}
if #signs_defined == last_sign_def_len or #signs_defined == 0 then
return
end
last_sign_def_len = #signs_defined
local bg = vim.api.nvim_get_hl(0, { name = "SignColumn", link = false }).bg
local cl_bg = vim.api.nvim_get_hl(0, { name = "CursorLineSign", link = false }).bg
for _, sign in ipairs(signs_defined) do
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, 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)
)
return { return {
setopt = true, setopt = true,
relculright = false, relculright = false,
@ -67,16 +35,4 @@ return {
} }
end, end,
}, },
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
current_line_blame = true,
current_line_blame_opts = {
delay = 0,
},
-- HACK: This allows the gitsigns to correctly use the culhl for their bg
_extmark_signs = false,
},
},
} }