From f86f1e810390ebe6aec3170deb7a9036734466e2 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 26 Jun 2017 10:01:00 +0200 Subject: [PATCH] whitespace: Only refresh on changes to buffer Should prevent too many redraws of Vim --- autoload/airline/extensions/whitespace.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/airline/extensions/whitespace.vim b/autoload/airline/extensions/whitespace.vim index 861fb280..cc6609cf 100644 --- a/autoload/airline/extensions/whitespace.vim +++ b/autoload/airline/extensions/whitespace.vim @@ -156,8 +156,12 @@ function! airline#extensions#whitespace#init(...) endfunction function! s:ws_refresh() + if get(b:, 'airline_ws_changedtick', 0) == b:changedtick + return + endif unlet! b:airline_whitespace_check if get(g:, 'airline_skip_empty_sections', 0) exe ':AirlineRefresh' endif + let b:airline_ws_changedtick = b:changedtick endfunction