mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-27 07:54:44 +02:00
async: Correctly reset dirty flag
This commit is contained in:
parent
79f91649b6
commit
9a1acf144f
@ -64,10 +64,10 @@ function! airline#async#vcs_untracked(config, file, vcs)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
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', {})
|
let var=getbufvar(fnameescape(a:file), 'buffer_vcs_config', {})
|
||||||
if has_key(var, a:vcs) && has_key(var[a:vcs], 'dirty')
|
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)
|
call setbufvar(fnameescape(a:file), 'buffer_vcs_config', var)
|
||||||
unlet! b:airline_head
|
unlet! b:airline_head
|
||||||
endif
|
endif
|
||||||
@ -82,9 +82,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_exit_clean(...) dict abort
|
function! s:on_exit_clean(...) dict abort
|
||||||
let buf=self.buf
|
let buf=self.buf
|
||||||
if !empty(buf)
|
call s:set_clean_variables(self.file, self.vcs, !empty(buf))
|
||||||
call s:set_clean_variables(self.file, self.vcs)
|
|
||||||
endif
|
|
||||||
if has_key(get(s:clean_jobs, self.vcs, {}), self.file)
|
if has_key(get(s:clean_jobs, self.vcs, {}), self.file)
|
||||||
call remove(s:clean_jobs[self.vcs], self.file)
|
call remove(s:clean_jobs[self.vcs], self.file)
|
||||||
endif
|
endif
|
||||||
@ -365,7 +363,5 @@ function! airline#async#vim7_vcs_clean(cmd, file, vcs)
|
|||||||
let cmd = a:cmd .' 2>/dev/null'
|
let cmd = a:cmd .' 2>/dev/null'
|
||||||
endif
|
endif
|
||||||
let output=system(cmd)
|
let output=system(cmd)
|
||||||
if !empty(output)
|
call s:set_clean_variables(a:file, a:vcs, !empty(output))
|
||||||
call s:set_clean_variables(a:file, a:vcs)
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user