diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index c776502..fb4dcaf 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -2177,6 +2177,21 @@ function! s:GF(mode) abort elseif getline('.') =~# '^[+-]\{3\} [ab/]' let ref = getline('.')[4:] + elseif getline('.') =~# '^[+-]' && search('^@@ -\d\+,\d\+ +\d\+,','bnW') + let type = getline('.')[0] + let lnum = line('.') - 1 + let offset = -1 + while getline(lnum) !~# '^@@ -\d\+,\d\+ +\d\+,' + if getline(lnum) =~# '^[ '.type.']' + let offset += 1 + endif + let lnum -= 1 + endwhile + let offset += matchstr(getline(lnum), type.'\zs\d\+') + let ref = getline(search('^'.type.'\{3\} [ab]/','bnW'))[4:-1] + let dcmd = '+'.offset.'|foldopen' + let dref = '' + elseif getline('.') =~# '^rename from ' let ref = 'a/'.getline('.')[12:] elseif getline('.') =~# '^rename to '