Decouple autocommand functions from repo object

This commit is contained in:
Tim Pope
2018-07-17 00:11:07 -04:00
parent c0b6faeae7
commit 29411e2801
2 changed files with 63 additions and 76 deletions

View File

@@ -160,7 +160,7 @@ augroup fugitive
\ if exists('b:NERDTree.root.path.str') |
\ call FugitiveDetect(b:NERDTree.root.path.str()) |
\ endif
autocmd VimEnter * if expand('<amatch>')==''|call FugitiveDetect(getcwd())|endif
autocmd VimEnter * if empty(expand('<amatch>'))|call FugitiveDetect(getcwd())|endif
autocmd CmdWinEnter * call FugitiveDetect(expand('#:p'))
autocmd FileType git
@@ -172,18 +172,18 @@ augroup fugitive
\ call fugitive#MapCfile() |
\ endif
autocmd BufReadCmd index{,.lock}
autocmd BufReadCmd index{,.lock}
\ if FugitiveIsGitDir(expand('<amatch>:p:h')) |
\ let b:git_dir = s:shellslash(expand('<amatch>:p:h')) |
\ exe fugitive#BufReadStatus() |
\ elseif filereadable(expand('<amatch>')) |
\ read <amatch> |
\ 1delete |
\ 1delete_ |
\ endif
autocmd BufReadCmd fugitive://*//[0-3]/* exe fugitive#BufReadIndex()
autocmd BufWriteCmd fugitive://*//[0-3]/* exe fugitive#BufWriteIndex()
autocmd BufReadCmd fugitive://*//[0-9a-f][0-9a-f]* exe fugitive#BufReadObject()
autocmd FileReadCmd fugitive://*//* exe fugitive#FileReadCmd()
autocmd SourceCmd fugitive://*//* nested exe fugitive#SourceCmd()
autocmd BufReadCmd fugitive://*//* exe fugitive#BufReadCmd()
autocmd BufWriteCmd fugitive://*//[0-3]/* exe fugitive#BufWriteCmd()
autocmd FileReadCmd fugitive://*//* exe fugitive#FileReadCmd()
autocmd SourceCmd fugitive://*//* nested exe fugitive#SourceCmd()
autocmd User Flags call Hoist('buffer', function('FugitiveStatusline'))
augroup END