From 9a1acf144fd63cae6f48a3b445958d737c0b167e Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 8 May 2019 17:22:34 +0200 Subject: [PATCH] async: Correctly reset dirty flag --- autoload/airline/async.vim | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/autoload/airline/async.vim b/autoload/airline/async.vim index be3a2531..74c4e72d 100644 --- a/autoload/airline/async.vim +++ b/autoload/airline/async.vim @@ -64,10 +64,10 @@ function! airline#async#vcs_untracked(config, file, vcs) endif endfunction -function! s:set_clean_variables(file, vcs) +function! s:set_clean_variables(file, vcs, val) let var=getbufvar(fnameescape(a:file), 'buffer_vcs_config', {}) if has_key(var, a:vcs) && has_key(var[a:vcs], 'dirty') - let var[a:vcs].dirty=1 + let var[a:vcs].dirty=a:val call setbufvar(fnameescape(a:file), 'buffer_vcs_config', var) unlet! b:airline_head endif @@ -82,9 +82,7 @@ endfunction function! s:on_exit_clean(...) dict abort let buf=self.buf - if !empty(buf) - call s:set_clean_variables(self.file, self.vcs) - endif + call s:set_clean_variables(self.file, self.vcs, !empty(buf)) if has_key(get(s:clean_jobs, self.vcs, {}), self.file) call remove(s:clean_jobs[self.vcs], self.file) endif @@ -365,7 +363,5 @@ function! airline#async#vim7_vcs_clean(cmd, file, vcs) let cmd = a:cmd .' 2>/dev/null' endif let output=system(cmd) - if !empty(output) - call s:set_clean_variables(a:file, a:vcs) - endif + call s:set_clean_variables(a:file, a:vcs, !empty(output)) endfunction