mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
Make all maps reblame at index when on dirty lines
Otherwise parent and grandparent maps lead to invalid URLs
This commit is contained in:
committed by
Tim Pope
parent
fe467f78bc
commit
8bf74ceef3
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user