mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
Support :Gedit /absolute/path when possible
Usage of /relative/path is deprecated in favor of ./relative/path, but it's still supported on top of this for now.
This commit is contained in:
@@ -385,7 +385,11 @@ function! s:repo_translate(spec, ...) dict abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:Generate(rev, ...) abort
|
function! s:Generate(rev, ...) abort
|
||||||
return fugitive#repo(a:0 ? a:1 : b:git_dir).translate(a:rev, 1)
|
let repo = fugitive#repo(a:0 ? a:1 : b:git_dir)
|
||||||
|
if a:rev =~# '^\%(\a\+:\)\=/' && getftime(a:rev) >= 0 && getftime(repo.tree() . a:rev) < 0
|
||||||
|
return s:PlatformSlash(a:rev)
|
||||||
|
endif
|
||||||
|
return repo.translate(a:rev, 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:repo_head(...) dict abort
|
function! s:repo_head(...) dict abort
|
||||||
|
|||||||
Reference in New Issue
Block a user