diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 56badb5..0cba062 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2497,7 +2497,7 @@ function! s:ReplaceCmd(cmd) abort throw 'fugitive: ' . (len(err) ? substitute(err, "\n$", '', '') : 'unknown error running ' . string(a:cmd)) endif setlocal noswapfile - silent exe 'lockmarks keepalt 0read ++edit' s:fnameescape(temp) + silent exe 'lockmarks keepalt noautocmd 0read ++edit' s:fnameescape(temp) if &foldenable && foldlevel('$') > 0 set nofoldenable silent keepjumps $delete _ @@ -2507,7 +2507,7 @@ function! s:ReplaceCmd(cmd) abort endif call delete(temp) if s:cpath(fnamemodify(bufname('$'), ':p'), temp) - silent! execute bufnr('$') . 'bwipeout' + silent! noautocmd execute bufnr('$') . 'bwipeout' endif endfunction diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 6bfaded..3d1d5ef 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -642,26 +642,26 @@ augroup fugitive \ endif | \ let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'exe') . '|setl inex= inc=' - autocmd BufReadCmd index{,.lock} + autocmd BufReadCmd index{,.lock} nested \ if FugitiveIsGitDir(expand(':p:h')) | \ let b:git_dir = s:Slash(expand(':p:h')) | \ exe fugitive#BufReadStatus(v:cmdbang) | \ elseif filereadable(expand('')) | \ silent doautocmd BufReadPre | - \ keepalt read | - \ 1delete_ | + \ keepalt noautocmd read | + \ silent 1delete_ | \ silent doautocmd BufReadPost | \ else | \ silent doautocmd BufNewFile | \ endif - autocmd BufReadCmd fugitive://*//* exe fugitive#BufReadCmd() | + autocmd BufReadCmd fugitive://*//* nested exe fugitive#BufReadCmd() | \ if &path =~# '^\.\%(,\|$\)' | \ let &l:path = substitute(&path, '^\.,\=', '', '') | \ endif - autocmd BufWriteCmd fugitive://*//[0-3]/* exe fugitive#BufWriteCmd() - autocmd FileReadCmd fugitive://*//* exe fugitive#FileReadCmd() - autocmd FileWriteCmd fugitive://*//[0-3]/* exe fugitive#FileWriteCmd() + autocmd BufWriteCmd fugitive://*//[0-3]/* nested exe fugitive#BufWriteCmd() + autocmd FileReadCmd fugitive://*//* nested exe fugitive#FileReadCmd() + autocmd FileWriteCmd fugitive://*//[0-3]/* nested exe fugitive#FileWriteCmd() if exists('##SourceCmd') autocmd SourceCmd fugitive://*//* nested exe fugitive#SourceCmd() endif