fix: check expicitely wether new hl group names are supported by checking for @comment

This commit is contained in:
Folke Lemaitre
2022-09-10 22:18:47 +02:00
parent dbf43002d6
commit ffa77681c3

View File

@@ -45,9 +45,12 @@ function M.invert_color(color)
return color
end
-- new in 0.8 something
local has_new_group_names = vim.fn.hlexists("@comment") ~= 0
---@param group string
function M.highlight(group, color)
if group:sub(1,1) == "@" and vim.fn.has("nvim-0.8") == 0 then
if group:sub(1, 1) == "@" and not has_new_group_names then
return
end
local hl = { fg = color.fg, bg = color.bg, sp = color.sp, link = color.link }