Rudimentary support for diff maps for submodules in status

This commit is contained in:
Maksim Odnoletkov
2019-09-13 00:25:21 +01:00
committed by Tim Pope
parent a21ca7e86e
commit 973d814e26

View File

@@ -2980,7 +2980,15 @@ function! s:StageDiff(diff) abort
let lnum = line('.') let lnum = line('.')
let info = s:StageInfo(lnum) let info = s:StageInfo(lnum)
let prefix = info.offset > 0 ? '+' . info.offset : '' 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' return 'Git! diff --no-ext-diff --cached'
elseif empty(info.paths) elseif empty(info.paths)
return 'Git! diff --no-ext-diff' return 'Git! diff --no-ext-diff'