From a6b7267979942348f19e4b3fe9d25d596da5f5a0 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 18 Nov 2020 09:13:32 +0100 Subject: [PATCH] highlighter: vim9 script implementation of s:hl_group_exists --- autoload/airline/highlighter.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index f845d7db..0c80dada 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -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