highlighter: check for accents key

This is actually a work around for a broken installation. the dict p
should always contain the accents key (see `airline#themes#patch()`
function, that adds missing accents). So even if the theme does not
define the accents key, it should always exist.

However, an error while evaluating the statusline is extremely annoying,
so add some safeguards here and skip the following for loop.

related #2043
This commit is contained in:
Christian Brabandt
2020-01-20 12:28:04 +01:00
parent 62976a21b0
commit a676af7c8a

View File

@@ -281,6 +281,12 @@ function! airline#highlighter#highlight(modes, ...)
call airline#highlighter#exec(name.suffix, mode_colors)
endif
if !has_key(p, 'accents')
" work arout a brocken installation
" shouldn't actually happen, p should always contain accents
continue
endif
for accent in keys(s:accents)
if !has_key(p.accents, accent)
continue