do not cache status of statusline per tabpage

When cacheing the values of buffer number, window number per tabpage, we
might forget to update the statusline when it is actually needed, e.g.
on `:tab help h | norm! gt` which would then still display "Help" also
we are not in a help window anymore.

Therefore cache those values (including current tabpage number)
globally.

fixes #1253
This commit is contained in:
Christian Brabandt 2016-09-14 19:05:57 +02:00
parent 65b9aa4856
commit 6e3c0c1c14
1 changed files with 3 additions and 3 deletions

View File

@ -39,12 +39,12 @@ function! s:on_window_changed()
endif
" Handle each window only once, since we might come here several times for
" different autocommands.
let l:key = [bufnr('%'), winnr(), winnr('$')]
if get(t:, 'airline_last_window_changed', []) == l:key
let l:key = [bufnr('%'), winnr(), winnr('$'), tabpagenr()]
if get(g:, 'airline_last_window_changed', []) == l:key
\ && &stl is# '%!airline#statusline('.winnr().')'
return
endif
let t:airline_last_window_changed = l:key
let g:airline_last_window_changed = l:key
call s:init()
call airline#update_statusline()
endfunction