Remove legacy autocommands

This commit is contained in:
Tim Pope
2020-01-21 05:10:39 -05:00
parent 71038e83f1
commit 9d62c67737
2 changed files with 5 additions and 13 deletions

View File

@@ -1909,7 +1909,7 @@ function! fugitive#BufReadStatus() abort
endfor endfor
let b:fugitive_reltime = reltime() let b:fugitive_reltime = reltime()
return 'silent ' . s:DoAutocmd('User FugitiveIndex') return 'silent ' . s:DoAutocmd('User Fugitive') . '|silent ' . s:DoAutocmd('User FugitiveIndex')
catch /^fugitive:/ catch /^fugitive:/
return 'echoerr ' . string(v:exception) return 'echoerr ' . string(v:exception)
endtry endtry
@@ -6305,20 +6305,9 @@ function! fugitive#foldtext() abort
return fugitive#Foldtext() return fugitive#Foldtext()
endfunction endfunction
augroup fugitive_folding
autocmd!
autocmd User Fugitive
\ if &filetype =~# '^git\%(commit\)\=$' && &foldtext ==# 'foldtext()' |
\ set foldtext=fugitive#Foldtext() |
\ endif
augroup END
" Section: Initialization " Section: Initialization
function! fugitive#Init() abort function! fugitive#Init() abort
if exists('#User#FugitiveBoot')
exe s:DoAutocmd('User FugitiveBoot')
endif
let dir = s:Dir() let dir = s:Dir()
if &tags !~# '\.git' && @% !~# '\.git' && !exists('s:tags_warning') if &tags !~# '\.git' && @% !~# '\.git' && !exists('s:tags_warning')
let actualdir = fugitive#Find('.git/', dir) let actualdir = fugitive#Find('.git/', dir)
@@ -6329,7 +6318,6 @@ function! fugitive#Init() abort
echohl NONE echohl NONE
endif endif
endif endif
exe s:DoAutocmd('User Fugitive')
endfunction endfunction
function! fugitive#is_git_dir(path) abort function! fugitive#is_git_dir(path) abort

View File

@@ -357,6 +357,10 @@ augroup fugitive
\ if len(FugitiveGitDir()) | \ if len(FugitiveGitDir()) |
\ call fugitive#MapCfile('fugitive#MessageCfile()') | \ call fugitive#MapCfile('fugitive#MessageCfile()') |
\ endif \ endif
autocmd FileType git,gitcommit
\ if len(FugitiveGitDir()) && &foldtext ==# 'foldtext()' |
\ setlocal foldtext=fugitive#Foldtext() |
\ endif
autocmd FileType fugitive autocmd FileType fugitive
\ if len(FugitiveGitDir()) | \ if len(FugitiveGitDir()) |
\ call fugitive#MapCfile('fugitive#StatusCfile()') | \ call fugitive#MapCfile('fugitive#StatusCfile()') |