From 562d060b087e09224fce76c17d38726641957ca1 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Fri, 24 Feb 2017 18:24:30 +0100 Subject: [PATCH] Reset wordcount cache on window size so the format can make a better guess what to display on different window sizes. --- autoload/airline/extensions/wordcount.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/wordcount.vim b/autoload/airline/extensions/wordcount.vim index 4bb25635..e424f5e3 100644 --- a/autoload/airline/extensions/wordcount.vim +++ b/autoload/airline/extensions/wordcount.vim @@ -16,11 +16,13 @@ function! s:update() else if get(b:, 'airline_wordcount_cache', '') is# '' || \ 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 let b:airline_wordcount = airline#extensions#wordcount#formatters#{s:formatter}#format() let b:airline_wordcount_cache = b:airline_wordcount let b:airline_change_tick = b:changedtick + let b:airline_winwidth = winwidth(0) endif endif endif