add guard for possible undefined window context (#276).

This commit is contained in:
Bailey Ling 2013-10-06 09:03:47 -04:00
parent af330f6a47
commit 491091706f
1 changed files with 6 additions and 1 deletions

View File

@ -120,7 +120,12 @@ function! s:invoke_funcrefs(context, funcrefs)
endfunction
function! airline#statusline(winnr)
if has_key(s:contexts, a:winnr)
return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
endif
" in rare circumstances this happens...see #276
return ''
endfunction
function! airline#check_mode(winnr)