Temporarily restore User Fugitive autocommand

References https://github.com/tpope/vim-fugitive/issues/1441
This commit is contained in:
Tim Pope committed 2020-01-25 11:29:13 -05:00
1 parent 4637aca145
commit 90b7d98b6c
2 files changed
+18 -1

No files matched your search

+17
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