fix: refresh airline when airline_skip_empty_sections enabled in plugin ale

This commit is contained in:
kaidiren 2017-08-26 19:00:40 +08:00
parent db907f5598
commit 2b45581f1c
1 changed files with 10 additions and 0 deletions

View File

@ -43,4 +43,14 @@ endfunction
function! airline#extensions#ale#init(ext)
call airline#parts#define_function('ale_error_count', 'airline#extensions#ale#get_error')
call airline#parts#define_function('ale_warning_count', 'airline#extensions#ale#get_warning')
augroup airline_ale
autocmd!
autocmd CursorHold,BufWritePost * call <sid>ale_refresh()
augroup END
endfunction
function! s:ale_refresh()
if get(g:, 'airline_skip_empty_sections', 0)
exe ':AirlineRefresh'
endif
endfunction