Fix jump to line on reblame

Discovered when investigating #112.
This commit is contained in:
Tim Pope 2011-10-01 02:26:26 -04:00
parent 1eeeb41f3f
commit 30038b82a4

View File

@ -1506,8 +1506,8 @@ function! s:BlameJump(suffix) abort
if commit =~# '^0\+$'
let commit = ':0'
endif
let lnum = matchstr(getline('.'),'\d\+\ze\s\+[([:digit:]]')
let path = matchstr(getline('.'),'^\^\=\zs\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]')
let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
if path ==# ''
let path = s:buffer(b:fugitive_blamed_bufnr).path()
endif
@ -1519,6 +1519,7 @@ function! s:BlameJump(suffix) abort
exe winnr.'wincmd w'
endif
execute s:Edit('edit', 0, commit.a:suffix.':'.path)
execute lnum
if winnr > 0
exe bufnr.'bdelete'
endif