From 89e6b5e4e1d8152bfc3c26aa2655c0342d0809d1 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 11 Oct 2020 20:42:35 -0400 Subject: [PATCH] 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 --- autoload/fugitive.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 5437c7f..c613142 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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