mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-26 18:31:02 +08:00
Do not overwrite v:shell_overwrite after ShellCmdPost
Prevents resetting v:shell_error from the followin system() call in get_git_untracked. Fixes #1266
This commit is contained in:
parent
73152217fb
commit
c1704a2de0
|
@ -203,7 +203,16 @@ function! s:check_in_path()
|
|||
return b:airline_file_in_root
|
||||
endfunction
|
||||
|
||||
function! s:reset_untracked_cache()
|
||||
function! s:reset_untracked_cache(shellcmdpost)
|
||||
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
|
||||
if exists("s:untracked_git")
|
||||
let s:untracked_git={}
|
||||
endif
|
||||
|
@ -218,5 +227,6 @@ function! airline#extensions#branch#init(ext)
|
|||
autocmd BufReadPost * unlet! b:airline_file_in_root
|
||||
autocmd CursorHold,ShellCmdPost,CmdwinLeave * unlet! b:airline_head
|
||||
autocmd User AirlineBeforeRefresh unlet! b:airline_head
|
||||
autocmd BufWritePost,ShellCmdPost * call s:reset_untracked_cache()
|
||||
autocmd BufWritePost * call s:reset_untracked_cache(0)
|
||||
autocmd ShellCmdPost * call s:reset_untracked_cache(1)
|
||||
endfunction
|
||||
|
|
Loading…
Reference in New Issue
Block a user