Disable 'swapfile' early

This should eliminate the need to disable 'swapfile' in
fugitive#BufReadCmd(), but I'm inclined not to fix what isn't broken.

Closes https://github.com/tpope/vim-fugitive/issues/1598
This commit is contained in:
Tim Pope
2020-10-11 20:42:35 -04:00
parent 4189bdb580
commit 89e6b5e4e1

View File

@@ -1641,6 +1641,7 @@ function! s:ReplaceCmd(cmd) abort
if exec_error
call s:throw((len(err) ? err : filereadable(temp) ? join(readfile(temp), ' ') : 'unknown error running ' . a:cmd))
endif
setlocal noswapfile
silent exe 'lockmarks keepalt 0read ++edit' s:fnameescape(temp)
if &foldenable && foldlevel('$') > 0
set nofoldenable