diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index b35ae793..3de3174b 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -119,7 +119,15 @@ function! airline#highlighter#exec(group, colors) abort let colors = s:CheckDefined(colors) if old_hi != new_hi || !s:hl_group_exists(a:group) let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors)) - exe cmd + try + exe cmd + catch /^Vim\%((\a\+)\)\=:E421:/ " color definition not found + let group=matchstr(v:exception, '\w\+\ze=') + let color=matchstr(v:exception, '=\zs\w\+') + let cmd=substitute(cmd, color, 'grey', 'g') + exe cmd + call airline#util#warning('color definition for group ' . a:group . ' not found, using grey as fallback') + endtry if has_key(s:hl_groups, a:group) let s:hl_groups[a:group] = colors endif