From 8bf74ceef3659a9e5201dbc90a27f037b8f97908 Mon Sep 17 00:00:00 2001 From: Maksim Odnoletkov Date: Fri, 11 Jan 2019 23:52:38 +0000 Subject: [PATCH] Make all maps reblame at index when on dirty lines Otherwise parent and grandparent maps lead to invalid URLs --- autoload/fugitive.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index e5b093c..499dbc0 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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'