diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index a6c0a1d..3a984c8 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -133,7 +133,7 @@ function! fugitive#extract_git_dir(path) abort return '' endfunction -function! s:Detect(path) +function! fugitive#detect(path) if exists('b:git_dir') && (b:git_dir ==# '' || b:git_dir =~# '/$') unlet b:git_dir endif @@ -162,10 +162,10 @@ endfunction augroup fugitive autocmd! - autocmd BufNewFile,BufReadPost * call s:Detect(expand(':p')) - autocmd FileType netrw call s:Detect(expand('%:p')) - autocmd User NERDTreeInit,NERDTreeNewRoot call s:Detect(b:NERDTreeRoot.path.str()) - autocmd VimEnter * if expand('')==''|call s:Detect(getcwd())|endif + autocmd BufNewFile,BufReadPost * call fugitive#detect(expand(':p')) + autocmd FileType netrw call fugitive#detect(expand('%:p')) + autocmd User NERDTreeInit,NERDTreeNewRoot call fugitive#detect(b:NERDTreeRoot.path.str()) + autocmd VimEnter * if expand('')==''|call fugitive#detect(getcwd())|endif autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('')), 'fugitive_leave') augroup END @@ -2251,7 +2251,7 @@ augroup fugitive_temp \ if has_key(s:temp_files,expand(':p')) | \ let b:git_dir = s:temp_files[expand(':p')] | \ let b:git_type = 'temp' | - \ call s:Detect(expand(':p')) | + \ call fugitive#detect(expand(':p')) | \ setlocal bufhidden=delete | \ nnoremap q :bdelete| \ endif