mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -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
|
function! s:BlameJump(suffix) abort
|
||||||
let commit = matchstr(getline('.'),'^\^\=\zs\x\+')
|
let commit = matchstr(getline('.'),'^\^\=\zs\x\+')
|
||||||
|
let suffix = a:suffix
|
||||||
if commit =~# '^0\+$'
|
if commit =~# '^0\+$'
|
||||||
let commit = ':0'
|
let commit = ':0'
|
||||||
|
let suffix = ''
|
||||||
endif
|
endif
|
||||||
let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]')
|
let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]')
|
||||||
let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
|
let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
|
||||||
@@ -3699,7 +3701,7 @@ function! s:BlameJump(suffix) abort
|
|||||||
if winnr > 0
|
if winnr > 0
|
||||||
exe winnr.'wincmd w'
|
exe winnr.'wincmd w'
|
||||||
endif
|
endif
|
||||||
execute 'Gedit' s:fnameescape(commit . a:suffix . ':' . path)
|
execute 'Gedit' s:fnameescape(commit . suffix . ':' . path)
|
||||||
execute lnum
|
execute lnum
|
||||||
if winnr > 0
|
if winnr > 0
|
||||||
exe bufnr.'bdelete'
|
exe bufnr.'bdelete'
|
||||||
|
|||||||
Reference in New Issue
Block a user