whitespace: Only refresh on changes to buffer

Should prevent too many redraws of Vim
This commit is contained in:
Christian Brabandt 2017-06-26 10:01:00 +02:00
parent 811360a095
commit f86f1e8103
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 4 additions and 0 deletions

View File

@ -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