From 66073d955d77c342dd2e1ace2190e50c6b663d36 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 23 Feb 2019 16:49:19 -0500 Subject: [PATCH] Use blamed file when calling :Gbrowse in blame buffer --- autoload/fugitive.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9ac877f..3dad996 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -626,7 +626,11 @@ function! fugitive#Path(url, ...) abort endwhile return a:1[0:-2] . path endif - let url = s:Slash(fnamemodify(a:url, ':p')) + let url = a:url + if has_key(get(s:temp_files, s:cpath(url), {}), 'bufnr') + let url = bufname(s:temp_files[s:cpath(url)].bufnr) + endif + let url = s:Slash(fnamemodify(url, ':p')) if url =~# '/$' && s:Slash(a:url) !~# '/$' let url = url[0:-2] endif