From 2b45581f1c146356f258c4317a784b012816a52e Mon Sep 17 00:00:00 2001 From: kaidiren Date: Sat, 26 Aug 2017 19:00:40 +0800 Subject: [PATCH] fix: refresh airline when airline_skip_empty_sections enabled in plugin ale --- autoload/airline/extensions/ale.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/autoload/airline/extensions/ale.vim b/autoload/airline/extensions/ale.vim index 97eadf4..07639a8 100644 --- a/autoload/airline/extensions/ale.vim +++ b/autoload/airline/extensions/ale.vim @@ -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 ale_refresh() + augroup END +endfunction + +function! s:ale_refresh() + if get(g:, 'airline_skip_empty_sections', 0) + exe ':AirlineRefresh' + endif endfunction