Make all maps reblame at index when on dirty lines

Otherwise parent and grandparent maps lead to invalid URLs
This commit is contained in:
Maksim Odnoletkov
2019-01-11 23:52:38 +00:00
committed by Tim Pope
parent fe467f78bc
commit 8bf74ceef3

View File

@@ -3684,8 +3684,10 @@ endfunction
function! s:BlameJump(suffix) abort
let commit = matchstr(getline('.'),'^\^\=\zs\x\+')
let suffix = a:suffix
if commit =~# '^0\+$'
let commit = ':0'
let suffix = ''
endif
let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]')
let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
@@ -3699,7 +3701,7 @@ function! s:BlameJump(suffix) abort
if winnr > 0
exe winnr.'wincmd w'
endif
execute 'Gedit' s:fnameescape(commit . a:suffix . ':' . path)
execute 'Gedit' s:fnameescape(commit . suffix . ':' . path)
execute lnum
if winnr > 0
exe bufnr.'bdelete'