diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 3925aae..7cac28d 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -3269,7 +3269,17 @@ function! s:RunEdit(state, tmp, job) abort call remove(a:state, 'request') let sentinel = a:state.file . '.edit' let file = FugitiveVimPath(readfile(sentinel, '', 1)[0]) - exe substitute(a:state.mods, '\', '-tab', 'g') 'keepalt split' s:fnameescape(file) + try + if !&equalalways && a:state.mods !~# '\' && 3 > (a:state.mods =~# '\', '-tab', 'g') 'keepalt split' s:fnameescape(file) + finally + if exists('l:noequalalways') + setglobal noequalalways + endif + endtry set bufhidden=wipe let bufnr = bufnr('') let s:edit_jobs[bufnr] = [a:state, a:tmp, a:job, sentinel] @@ -6494,7 +6504,7 @@ function! fugitive#Diffsplit(autodir, keepfocus, mods, arg, ...) abort return 'echoerr ' . string(v:exception) finally if exists('l:equalalways') - let &l:equalalways = equalalways + let &g:equalalways = equalalways endif if exists('diffopt') let &diffopt = diffopt