Skip to content

Commit

Permalink
refactor!: remove utils.get_hex - use hlgroups.get_hl_attr
Browse files Browse the repository at this point in the history
Hard deprecates `get_hex` by removing it entirely. It has been
deprecated for a while, and causes issues with configs.
  • Loading branch information
willothy committed Sep 22, 2023
1 parent 9d2ec14 commit b56f12b
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions lua/cokeline/utils.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
local vim_fn = vim.fn

---Returns the color set by the current colorscheme for the `attr` attribute of
---the `hlgroup_name` highlight group in hexadecimal format.
---@deprecated
---@param hlgroup_name string
---@param attr '"fg"' | '"bg"'
---@return string
local get_hex = function(hlgroup_name, attr)
local hlgroup_ID = vim_fn.synIDtrans(vim_fn.hlID(hlgroup_name))
local hex = vim_fn.synIDattr(hlgroup_ID, attr)
return hex ~= "" and hex or "NONE"
end

---@param bufnr number
---@param focus_next boolean
---@param wipeout boolean
Expand Down Expand Up @@ -135,6 +121,5 @@ local function buf_delete(bufnr, focus, wipeout)
end

return {
get_hex = get_hex,
buf_delete = buf_delete,
}

0 comments on commit b56f12b

Please sign in to comment.