From a676af7c8afb3fb90baab9a9d2911bd260375018 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 20 Jan 2020 12:28:04 +0100 Subject: [PATCH] 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 --- autoload/airline/highlighter.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/autoload/airline/highlighter.vim b/autoload/airline/highlighter.vim index f7237102..fc902f3b 100644 --- a/autoload/airline/highlighter.vim +++ b/autoload/airline/highlighter.vim @@ -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