From 67c4c031fa547844abb37879da7101bd1b7488c1 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 14 Sep 2021 18:18:49 -0400 Subject: [PATCH] Support jump to diff from :Git log --name-status Resolves: https://github.com/tpope/vim-fugitive/issues/1838 --- autoload/fugitive.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a6d5cd0..732c71f 100644 --- 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:]