Merge pull request #996 from chrisbra/untracked_improvement

Small improvement for untracked feature
This commit is contained in:
Christian Brabandt 2016-02-08 10:27:13 +01:00
commit faaf58b2c5
1 changed files with 4 additions and 2 deletions

View File

@ -73,8 +73,10 @@ function! s:get_git_untracked(file)
if has_key(s:untracked_git, a:file) if has_key(s:untracked_git, a:file)
let untracked = s:untracked_git[a:file] let untracked = s:untracked_git[a:file]
else else
let untracked = ((system('git status --porcelain -- ' . a:file)[0:1]) is# '??' ? let output = system('git status --porcelain -- '. a:file)
\ get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists) : '') if output[0:1] is# '??' && output[3:-2] is? a:file
let untracked = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
endif
let s:untracked_git[a:file] = untracked let s:untracked_git[a:file] = untracked
endif endif
return untracked return untracked