mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-02-17 07:02:48 +08:00
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:
parent
62976a21b0
commit
a676af7c8a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user