From 0a352c9f5ba98051378f08d22d82de0fa6d14418 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sat, 24 Jun 2017 14:03:40 +0200 Subject: [PATCH] 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. --- autoload/airline/extensions/branch.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/autoload/airline/extensions/branch.vim b/autoload/airline/extensions/branch.vim index dcaaea6f..401f786b 100644 --- a/autoload/airline/extensions/branch.vim +++ b/autoload/airline/extensions/branch.vim @@ -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)