mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 14:23:51 -05:00
Include tree filename in <C-R><C-G>
This commit is contained in:
@@ -68,6 +68,16 @@ function! s:recall()
|
|||||||
let rev = s:sub(s:buffer().rev(), '^/', '')
|
let rev = s:sub(s:buffer().rev(), '^/', '')
|
||||||
if rev ==# ':'
|
if rev ==# ':'
|
||||||
return matchstr(getline('.'),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$\|^\d\{6} \x\{40\} \d\t\zs.*')
|
return matchstr(getline('.'),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$\|^\d\{6} \x\{40\} \d\t\zs.*')
|
||||||
|
elseif s:buffer().type('tree')
|
||||||
|
let file = matchstr(getline('.'), '\t\zs.*')
|
||||||
|
if empty(file) && line('.') > 2
|
||||||
|
let file = s:sub(getline('.'), '/$', '')
|
||||||
|
endif
|
||||||
|
if !empty(file) && rev !~# ':$'
|
||||||
|
return rev . '/' . file
|
||||||
|
else
|
||||||
|
return rev . file
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
return rev
|
return rev
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user