From 30038b82a45e7a7eb58d0215cc7a68b5b5c462b3 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 1 Oct 2011 02:26:26 -0400 Subject: [PATCH] Fix jump to line on reblame Discovered when investigating #112. --- plugin/fugitive.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index b3cd92d..35d41ae 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -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