From 6e3c0c1c14cd21b610deb43f0b76f6d4b27f8bad Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 14 Sep 2016 19:05:57 +0200 Subject: [PATCH] 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 --- plugin/airline.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/airline.vim b/plugin/airline.vim index 4ff26567..a6da1775 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -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