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:
Tim Pope
2018-08-02 15:31:42 -04:00
parent 80e410c81a
commit 1fea1e5821

View File

@@ -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