Temporarily restore User Fugitive autocommand

References https://github.com/tpope/vim-fugitive/issues/1441
This commit is contained in:
Tim Pope
2020-01-25 11:23:14 -05:00
parent 4637aca145
commit 90b7d98b6c
2 changed files with 18 additions and 1 deletions

View File

@@ -279,6 +279,23 @@ function! FugitiveDetect(path) abort
let b:git_dir = dir
endif
endif
if !exists('b:git_dir') || !exists('#User#Fugitive')
return ''
endif
if v:version >= 704 || (v:version == 703 && has('patch442'))
doautocmd <nomodeline> User Fugitive
elseif &modelines > 0
let modelines = &modelines
try
set modelines=0
doautocmd User Fugitive
finally
let &modelines = modelines
endtry
else
doautocmd User Fugitive
endif
return ''
endfunction
function! FugitiveVimPath(path) abort