From 1fea1e5821e8ed535dcb31c556783596c8745d07 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 2 Aug 2018 15:31:42 -0400 Subject: [PATCH] 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. --- autoload/fugitive.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 633ab0d..7c78a9d 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -385,7 +385,11 @@ function! s:repo_translate(spec, ...) dict abort endfunction 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 function! s:repo_head(...) dict abort