From ffa77681c36755bfc727b759dd4ec17b708ffabf Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 10 Sep 2022 22:18:47 +0200 Subject: [PATCH] fix: check expicitely wether new hl group names are supported by checking for @comment --- lua/tokyonight/util.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/tokyonight/util.lua b/lua/tokyonight/util.lua index e08b6ab..286b5aa 100644 --- a/lua/tokyonight/util.lua +++ b/lua/tokyonight/util.lua @@ -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 }