Provide "." and "<C-R><C-G>" in blame buffers

This commit is contained in:
Tim Pope
2021-04-06 23:40:43 -04:00
parent 50b57ba400
commit 485251ec73

View File

@@ -1142,7 +1142,7 @@ function! fugitive#Object(...) abort
let rev = ''
endif
let tree = s:Tree(dir)
let full = a:0 ? a:1 : @%
let full = a:0 ? a:1 : s:BufName('%')
let full = fnamemodify(full, ':p' . (s:Slash(full) =~# '/$' ? '' : ':s?/$??'))
if empty(rev) && empty(tree)
return FugitiveGitPath(full)
@@ -6043,6 +6043,7 @@ function! fugitive#BlameFileType() abort
call s:Map('n', 'o', ':<C-U>exe <SID>BlameCommit("split")<CR>', '<silent>')
call s:Map('n', 'O', ':<C-U>exe <SID>BlameCommit("tabedit")<CR>', '<silent>')
call s:Map('n', 'p', ':<C-U>exe <SID>BlameCommit("pedit")<CR>', '<silent>')
call s:Map('n', '.', ":<C-U> <C-R>=substitute(<SID>BlameCommitFileLnum()[0],'^$','@','')<CR><Home>")
endfunction
augroup fugitive_blame