Add filetype to chache, disable cache for fugitive

#1452 (partly)
This commit is contained in:
Christian Brabandt 2017-03-20 08:36:54 +01:00
parent 7813a54912
commit 703241942a
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -41,9 +41,12 @@ function! s:on_window_changed()
endif endif
" Handle each window only once, since we might come here several times for " Handle each window only once, since we might come here several times for
" different autocommands. " different autocommands.
let l:key = [bufnr('%'), winnr(), winnr('$'), tabpagenr()] let l:key = [bufnr('%'), winnr(), winnr('$'), tabpagenr(), &ft]
if get(g:, 'airline_last_window_changed', []) == l:key if get(g:, 'airline_last_window_changed', []) == l:key
\ && &stl is# '%!airline#statusline('.winnr().')' \ && &stl is# '%!airline#statusline('.winnr().')'
\ && ft !~? 'gitcommit'
" fugitive is special, it changes names and filetypes several times,
" make sure the caching does not get into its way
return return
endif endif
let g:airline_last_window_changed = l:key let g:airline_last_window_changed = l:key