commit 67c4c031fa547844abb37879da7101bd1b7488c1 (tree)
parent 79a6a1941d5a81deffb5c9897bd2966d721874ae
Author: Tim Pope <code@tpope.net>
Date: Tue, 14 Sep 2021 18:18:49 -0400
Support jump to diff from :Git log --name-status
Resolves: https://github.com/tpope/vim-fugitive/issues/1838
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -7661,6 +7661,15 @@ function! s:cfile() abort
let ref = matchstr(getline('.'),'\x\{40,\}')
echoerr "warning: unknown context ".matchstr(getline('.'),'^\l*')
+ elseif getline('.') =~# '^[A-Z]\d*\t\S' && len(myhash)
+ let files = split(getline('.'), "\t")[1:-1]
+ let ref = 'b/' . files[-1]
+ if getline('.') =~# '^D'
+ let ref = 'a/' . files[0]
+ elseif getline('.') !~# '^A'
+ let dcmds = ['', 'Gdiffsplit! >' . myhash . '^:' . fnameescape(files[0])]
+ endif
+
elseif getline('.') =~# '^[+-]\{3\} [abciow12]\=/'
let ref = getline('.')[4:]