Accept buffer number to FugitiveRoute()
This commit is contained in:
parent
44e5df8433
commit
4d3835f637
@ -522,7 +522,10 @@ function! s:Relative(...) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fugitive#Route(object, ...) abort
|
function! fugitive#Route(object, ...) abort
|
||||||
if a:object =~# '^[~$]'
|
if type(a:object) == type(0)
|
||||||
|
let name = bufname(a:object)
|
||||||
|
return s:PlatformSlash(name =~# '^$\|^/\|^\a\+:' ? name : getcwd() . '/' . name)
|
||||||
|
elseif a:object =~# '^[~$]'
|
||||||
let prefix = matchstr(a:object, '^[~$]\i*')
|
let prefix = matchstr(a:object, '^[~$]\i*')
|
||||||
let owner = expand(prefix)
|
let owner = expand(prefix)
|
||||||
return s:PlatformSlash((len(owner) ? owner : prefix) . strpart(a:object, len(prefix)))
|
return s:PlatformSlash((len(owner) ? owner : prefix) . strpart(a:object, len(prefix)))
|
||||||
|
@ -44,7 +44,7 @@ function! FugitiveReal(...) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitiveRoute(...) abort
|
function! FugitiveRoute(...) abort
|
||||||
return fugitive#Route(a:0 ? a:1 : ':/', FugitiveGitDir(a:0 > 1 ? a:2 : -1))
|
return fugitive#Route(a:0 ? a:1 : bufnr(''), FugitiveGitDir(a:0 > 1 ? a:2 : -1))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitivePath(...) abort
|
function! FugitivePath(...) abort
|
||||||
|
Loading…
Reference in New Issue
Block a user