fix: better check for support of new highlight groups

This commit is contained in:
Folke Lemaitre 2022-09-11 10:48:40 +02:00
parent eab88d434d
commit afd9c6137a
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040

View File

@ -1,10 +1,7 @@
local M = {}
-- new in 0.8 something
local has_new_group_names = vim.fn.hlexists("@comment") ~= 0
function M.get(group)
if group:sub(1, 1) ~= "@" or has_new_group_names then
if group:sub(1, 1) ~= "@" or not vim.treesitter.highlighter.hl_map then
return group
end