From 0508885550b7709e89d976c434b4c2a6a5caaf05 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 18 Mar 2021 23:15:49 -0400 Subject: [PATCH] Don't clobber alt buffer with :Gread Why does :read do this??? --- autoload/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index c8bdeca..e912926 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4662,7 +4662,7 @@ function! s:ReadPrepare(line1, count, range, mods) abort else let pre = '' endif - return [pre . mods . after . 'read', delete . 'diffupdate' . (a:count < 0 ? '|' . line('.') : '')] + return [pre . 'keepalt ' . mods . after . 'read', delete . 'diffupdate' . (a:count < 0 ? '|' . line('.') : '')] endfunction function! s:ReadExec(line1, count, range, mods, env, args, options) abort @@ -4685,7 +4685,7 @@ function! fugitive#ReadCommand(line1, count, range, bang, mods, arg, args) abort return 'echoerr ' . string(v:exception) endtry if file =~# '^fugitive:' && a:count is# 0 - return 'exe ' .string(s:Mods(a:mods) . fugitive#FileReadCmd(file, 0, pre)) . '|diffupdate' + return 'exe ' .string('keepalt ' . s:Mods(a:mods) . fugitive#FileReadCmd(file, 0, pre)) . '|diffupdate' endif return read . ' ' . pre . ' ' . s:fnameescape(file) . '|' . post endfunction