Fix detection of netrw buffers

How long has this been broken?
This commit is contained in:
Tim Pope 2012-04-11 16:41:43 -04:00
parent 9bfb7857ec
commit 4fe6e46a0a

View File

@ -161,7 +161,7 @@ endfunction
augroup fugitive augroup fugitive
autocmd! autocmd!
autocmd BufNewFile,BufReadPost * call s:Detect(expand('<amatch>:p')) autocmd BufNewFile,BufReadPost * call s:Detect(expand('<amatch>:p'))
autocmd FileType netrw call s:Detect(expand('<afile>:p')) autocmd FileType netrw call s:Detect(expand('%:p'))
autocmd User NERDTreeInit,NERDTreeNewRoot call s:Detect(b:NERDTreeRoot.path.str()) autocmd User NERDTreeInit,NERDTreeNewRoot call s:Detect(b:NERDTreeRoot.path.str())
autocmd VimEnter * if expand('<amatch>')==''|call s:Detect(getcwd())|endif autocmd VimEnter * if expand('<amatch>')==''|call s:Detect(getcwd())|endif
autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('<abuf>')), 'fugitive_leave') autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('<abuf>')), 'fugitive_leave')