Revert "Unify jump to file logic"
This reverts commit 73c39195aee0c80f9ef3cd433ee315d72931864e, which broke opening in a different window from :Gstatus.
This commit is contained in:
parent
73c39195ae
commit
49c2a4acb5
@ -3023,7 +3023,7 @@ function! fugitive#MapJumps(...) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:CfileList() abort
|
||||
function! s:cfile() abort
|
||||
try
|
||||
let myhash = s:DirRev(@%)[1]
|
||||
if len(myhash)
|
||||
@ -3208,36 +3208,32 @@ function! s:CfileList() abort
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:Cfile() abort
|
||||
let pre = ''
|
||||
let results = s:CfileList()
|
||||
if empty(results)
|
||||
return ''
|
||||
elseif len(results) > 1
|
||||
let pre = '+' . join(map(results[1:-1], 'escape(v:val, " ")'), '\|') . ' '
|
||||
endif
|
||||
return pre . s:fnameescape(s:Generate(results[0]))
|
||||
endfunction
|
||||
|
||||
function! s:GF(mode) abort
|
||||
let cfile = s:Cfile()
|
||||
if len(cfile)
|
||||
return a:mode . ' ' . cfile
|
||||
try
|
||||
let results = s:cfile()
|
||||
catch /^fugitive:/
|
||||
return 'echoerr v:errmsg'
|
||||
endtry
|
||||
if len(results)
|
||||
return s:Edit(a:mode, 0, '', results[0]).join(map(results[1:-1], '"|".v:val'), '')
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! fugitive#Cfile(...) abort
|
||||
function! fugitive#Cfile() abort
|
||||
let pre = ''
|
||||
let cfile = s:Cfile()
|
||||
if empty(cfile)
|
||||
let results = s:cfile()
|
||||
if empty(results)
|
||||
let cfile = expand('<cfile>')
|
||||
if &includeexpr =~# '\<v:fname\>'
|
||||
sandbox let cfile = eval(substitute(&includeexpr, '\C\<v:fname\>', '\=string(cfile)', 'g'))
|
||||
endif
|
||||
return cfile
|
||||
elseif len(results) > 1
|
||||
let pre = '+' . join(map(results[1:-1], 'escape(v:val, " ")'), '\|') . ' '
|
||||
endif
|
||||
return cfile
|
||||
return pre . s:fnameescape(s:Generate(results[0]))
|
||||
endfunction
|
||||
|
||||
function! fugitive#cfile() abort
|
||||
|
Loading…
x
Reference in New Issue
Block a user