include workaround from c1704a2de0e3d963714a
add workaround from commit c1704a2de0e3d963714a to prevent overwriting v:shell_error
This commit is contained in:
parent
ffa3d59af2
commit
57ca6c9e78
@ -248,7 +248,18 @@ function! s:check_in_path()
|
|||||||
return b:airline_file_in_root
|
return b:airline_file_in_root
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:reset_untracked_cache()
|
function! s:reset_untracked_cache(shellcmdpost)
|
||||||
|
if !s:has_async
|
||||||
|
if a:shellcmdpost
|
||||||
|
" function called after executing a shell command,
|
||||||
|
" only clear cache, if there was no error, else the
|
||||||
|
" system() command from get_git_untracked() would
|
||||||
|
" overwrite the v:shell_error status
|
||||||
|
if v:shell_error
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
if exists("s:untracked_git")
|
if exists("s:untracked_git")
|
||||||
let s:untracked_git={}
|
let s:untracked_git={}
|
||||||
endif
|
endif
|
||||||
@ -263,5 +274,7 @@ function! airline#extensions#branch#init(ext)
|
|||||||
autocmd BufReadPost * unlet! b:airline_file_in_root
|
autocmd BufReadPost * unlet! b:airline_file_in_root
|
||||||
autocmd CursorHold,ShellCmdPost,CmdwinLeave * unlet! b:airline_head
|
autocmd CursorHold,ShellCmdPost,CmdwinLeave * unlet! b:airline_head
|
||||||
autocmd User AirlineBeforeRefresh unlet! b:airline_head
|
autocmd User AirlineBeforeRefresh unlet! b:airline_head
|
||||||
autocmd ShellCmdPost,BufWritePost * call s:reset_untracked_cache()
|
autocmd BufWritePost * call s:reset_untracked_cache(0)
|
||||||
|
autocmd ShellCmdPost * call s:reset_untracked_cache(1)
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user