diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 4c39543..c577bd3 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5576,7 +5576,10 @@ endfunction function! s:BlameCommitFileLnum(...) abort let line = a:0 ? a:1 : getline('.') - let state = a:0 ? a:2 : s:TempState() + let state = a:0 > 1 ? a:2 : s:TempState() + if get(state, 'filetype', '') !=# 'fugitiveblame' + return ['', '', 0] + endif let commit = matchstr(line, '^\^\=[?*]*\zs\x\+') if commit =~# '^0\+$' let commit = '' @@ -6126,9 +6129,6 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo else let rev = arg endif - if rev ==# '' - let rev = s:DirRev(@%)[1] - endif if rev =~? '^\a\a\+:[\/][\/]' && rev !~? '^fugitive:' let rev = substitute(rev, '\\\@ 0 && bufname !=# bufname('') + let blame = s:BlameCommitFileLnum(getline(a:count)) + if len(blame[0]) + let expanded = blame[0] + endif + endif endif let cdir = FugitiveVimPath(fugitive#CommonDir(dir)) for subdir in ['tags/', 'heads/', 'remotes/']