Reset wordcount cache on window size

so the format can make a better guess what to display on different
window sizes.
This commit is contained in:
Christian Brabandt 2017-02-24 18:24:30 +01:00
parent d8b62aa426
commit 562d060b08
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -16,11 +16,13 @@ function! s:update()
else else
if get(b:, 'airline_wordcount_cache', '') is# '' || if get(b:, 'airline_wordcount_cache', '') is# '' ||
\ b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') || \ b:airline_wordcount_cache isnot# get(b:, 'airline_wordcount', '') ||
\ get(b:, 'airline_change_tick', 0) != b:changedtick \ get(b:, 'airline_change_tick', 0) != b:changedtick ||
\ get(b:, 'airline_winwidth', 0) != winwidth(0)
" cache data " cache data
let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format() let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format()
let b:airline_wordcount_cache = b:airline_wordcount let b:airline_wordcount_cache = b:airline_wordcount
let b:airline_change_tick = b:changedtick let b:airline_change_tick = b:changedtick
let b:airline_winwidth = winwidth(0)
endif endif
endif endif
endif endif