diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index ddf29bb..d8babb4 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1760,6 +1760,9 @@ function! s:ReplaceCmd(cmd,...) abort silent edit! silent exe 'keepalt file '.s:fnameescape(fn) call delete(tmp) + if bufname('$') == tmp + silent execute 'bwipeout '.bufnr('$') + endif silent exe 'doau BufReadPost '.s:fnameescape(fn) endfunction @@ -1812,7 +1815,7 @@ function! s:BufReadIndex() nnoremap dv :execute StageDiff('Gvdiff') nnoremap p :execute StagePatch(line('.'),line('.')+v:count1-1) xnoremap p :execute StagePatch(line("'<"),line("'>")) - nnoremap q :bdelete + nnoremap q :if bufnr('$') == 1quitelsebdeleteendif nnoremap R :edit catch /^fugitive:/ return 'echoerr v:errmsg'