mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-08-12 19:06:56 +08:00
check for existence of git/hg before calling them
This commit is contained in:
@@ -71,7 +71,7 @@ function! s:get_git_branch(path)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:get_git_untracked(file)
|
function! s:get_git_untracked(file)
|
||||||
if empty(a:file)
|
if empty(a:file) || !executable('git')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
if !has_key(s:untracked_git, a:file)
|
if !has_key(s:untracked_git, a:file)
|
||||||
@@ -88,7 +88,7 @@ function! s:get_git_untracked(file)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:get_hg_untracked(file)
|
function! s:get_hg_untracked(file)
|
||||||
if !s:has_lawrencium && empty(a:file)
|
if !s:has_lawrencium || empty(a:file) || !executable('hg')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
" delete cache when unlet b:airline head?
|
" delete cache when unlet b:airline head?
|
||||||
|
|||||||
Reference in New Issue
Block a user