highlighter: vim9 script implementation of s:hl_group_exists

This commit is contained in:
Christian 2020-11-18 09:13:32 +01:00 committed by Christian Brabandt
parent 90de76359f
commit a6b7267979
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -394,4 +394,12 @@ else
var rest = [ rest1, rest2, rest3 ]
return s:get_array(guifg, guibg, ctermfg, ctermbg, filter(rest, {_, v -> !empty(v)}))
enddef
def s:hl_group_exists(group: string): bool # {{{2
if !hlexists(group)
return false
elseif hlID(group)->synIDtrans()->synIDattr('fg')->empty()
return false
endif
return true
enddef
endif