branch: don't check untracked status for files in vcs dir
Currently, vim-airline will check untracked status for files e.g. living in .git. So when editing .git/config it will show as being untracked. While technically, this is correct I prefer not to see this for those files. So skip the check for those files.
This commit is contained in:
parent
ac032b752a
commit
0a352c9f5b
@ -29,6 +29,7 @@ let s:vcs_config = {
|
||||
\ 'cmd': 'git status --porcelain -- ',
|
||||
\ 'untracked_mark': '??',
|
||||
\ 'update_branch': 's:update_git_branch',
|
||||
\ 'exclude': '\.git',
|
||||
\ 'branch': '',
|
||||
\ 'untracked': {},
|
||||
\ },
|
||||
@ -36,6 +37,7 @@ let s:vcs_config = {
|
||||
\ 'exe': 'hg',
|
||||
\ 'cmd': 'hg status -u -- ',
|
||||
\ 'untracked_mark': '?',
|
||||
\ 'exclude': '\.hg',
|
||||
\ 'update_branch': 's:update_hg_branch',
|
||||
\ 'branch': '',
|
||||
\ 'untracked': {},
|
||||
@ -165,6 +167,10 @@ function! s:update_untracked()
|
||||
|
||||
let l:needs_update = 1
|
||||
for vcs in keys(s:vcs_config)
|
||||
if l:file =~ s:vcs_config[vcs].exclude
|
||||
" Skip check for files that live in the exclude directory
|
||||
let l:needs_update = 0
|
||||
endif
|
||||
if has_key(s:vcs_config[vcs].untracked, l:file)
|
||||
let l:needs_update = 0
|
||||
call s:update_untracked_in_buffer_config(l:file, vcs)
|
||||
|
Loading…
Reference in New Issue
Block a user