fix: load Vim's highlight groups foreground as hex

This commit is contained in:
kiyan 2021-03-08 00:16:41 +01:00
parent 58e44d29d7
commit 7e3534c2bc

View File

@ -7,10 +7,10 @@ local function get_color_from_hl(hl_name, fallback)
local id = vim.api.nvim_get_hl_id_by_name(hl_name)
if not id then return fallback end
local hl = vim.api.nvim_get_hl_by_id(id, true)
if not hl or not hl.foreground then return fallback end
local foreground = vim.fn.synIDattr(id, "fg")
if not foreground then return fallback end
return hl.foreground
return foreground
end
local function get_colors()