branch: Check untracked and dirty only wehn the fugitive/lawrencium plugins are installed

This commit is contained in:
Christian Brabandt 2019-05-08 13:57:25 +02:00
parent 1b41629214
commit 79f91649b6
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -197,6 +197,13 @@ function! s:update_untracked()
endif endif
for vcs in keys(s:vcs_config) for vcs in keys(s:vcs_config)
" only check, for git, if fugitive is installed
" and for 'hg' if lawrencium is installed, else skip
if vcs is# 'git' && !airline#util#has_fugitive()
continue
elseif vcs is# 'mercurial' && !airline#util#has_lawrencium()
continue
endif
let config = s:vcs_config[vcs] let config = s:vcs_config[vcs]
" Note that asynchronous update updates s:vcs_config only, and only " Note that asynchronous update updates s:vcs_config only, and only
" s:update_untracked updates b:buffer_vcs_config. If s:vcs_config is " s:update_untracked updates b:buffer_vcs_config. If s:vcs_config is