mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -05:00
Smarter diff jumping in :Git log
Closes https://github.com/tpope/vim-fugitive/issues/1689
This commit is contained in:
@@ -6131,8 +6131,15 @@ function! s:cfile() abort
|
|||||||
let myhash = ''
|
let myhash = ''
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
if empty(myhash) && getline(1) =~# '^\%(commit\|tag\) \w'
|
if empty(myhash) && get(s:TempState(), 'filetype', '') ==# 'git'
|
||||||
let myhash = matchstr(getline(1),'^\w\+ \zs\S\+')
|
let lnum = line('.')
|
||||||
|
while lnum > 0
|
||||||
|
if getline(lnum) =~# '^\%(commit\|tag\) \w'
|
||||||
|
let myhash = matchstr(getline(lnum),'^\w\+ \zs\S\+')
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let lnum -= 1
|
||||||
|
endwhile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let showtree = (getline(1) =~# '^tree ' && getline(2) == "")
|
let showtree = (getline(1) =~# '^tree ' && getline(2) == "")
|
||||||
|
|||||||
Reference in New Issue
Block a user