diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 811918c..f038972 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -276,7 +276,7 @@ endfunction augroup fugitive autocmd! autocmd BufNewFile,BufReadPost * call FugitiveDetect(expand('%:p')) - autocmd FileType netrw call FugitiveDetect(expand('%:p')) + autocmd FileType netrw call FugitiveDetect(fnamemodify(get(b:, 'netrw_curdir', @%), ':p')) autocmd User NERDTreeInit,NERDTreeNewRoot call FugitiveDetect(b:NERDTree.root.path.str()) autocmd VimEnter * if expand('')==''|call FugitiveDetect(getcwd())|endif autocmd CmdWinEnter * call FugitiveDetect(expand('#:p'))