From 973d814e26db486d6b4d46a3dfed56be612bd759 Mon Sep 17 00:00:00 2001 From: Maksim Odnoletkov Date: Fri, 13 Sep 2019 00:25:21 +0100 Subject: [PATCH] Rudimentary support for diff maps for submodules in status --- autoload/fugitive.vim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 970233b..5513a7b 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2980,7 +2980,15 @@ function! s:StageDiff(diff) abort let lnum = line('.') let info = s:StageInfo(lnum) let prefix = info.offset > 0 ? '+' . info.offset : '' - if empty(info.paths) && info.section ==# 'Staged' + if info.sub =~# '^S' + if info.section ==# 'Staged' + return 'Git! diff --no-ext-diff --submodule=log --cached -- ' . info.paths[0] + elseif info.sub =~# '^SC' + return 'Git! diff --no-ext-diff --submodule=log -- ' . info.paths[0] + else + return 'Git! diff --no-ext-diff --submodule=diff -- ' . info.paths[0] + endif + elseif empty(info.paths) && info.section ==# 'Staged' return 'Git! diff --no-ext-diff --cached' elseif empty(info.paths) return 'Git! diff --no-ext-diff'