highlighter: use synIDtrans() in s:hl_group_exists (legacy vimscript)

When checking the defined foreground color in the function that checks
whether a highlighting group exists, it should follow the syntax group
links and check the final color.
This commit is contained in:
Christian 2020-11-18 09:10:22 +01:00 committed by Christian Brabandt
parent 0238d386bb
commit 90de76359f
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -88,7 +88,7 @@ if !exists(":def") || (exists(":def") && get(g:, "airline_experimental", 0)==0)
function! s:hl_group_exists(group) abort " {{{2 function! s:hl_group_exists(group) abort " {{{2
if !hlexists(a:group) if !hlexists(a:group)
return 0 return 0
elseif empty(synIDattr(hlID(a:group), 'fg')) elseif empty(synIDattr(synIDtrans(hlID(a:group)), 'fg'))
return 0 return 0
endif endif
return 1 return 1