commit aebbbd335eeb2f753b1650180bd31349c4208209 (tree)
parent 3366704c8f3f5df476bd34afb723f59ed4fb1dbf
Author: Tim Pope <code@tpope.net>
Date: Mon, 25 Apr 2011 11:50:19 -0400
Map dp in stage conflict to do the right thing
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -1124,10 +1124,13 @@ function! s:Diff(bang,...) abort
if exists(':DiffGitCached')
return 'DiffGitCached'
elseif (!a:0 || a:1 == ':') && s:buffer().commit() =~# '^[0-1]\=$' && s:repo().git_chomp_in_tree('ls-files', '--unmerged', '--', s:buffer().path()) !=# ''
+ let nr = bufnr('')
execute 'leftabove '.split.' `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`'
+ execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<CR>'
diffthis
wincmd p
execute 'rightbelow '.split.' `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`'
+ execute 'nnoremap dp <buffer> <silent> :diffput '.nr.'<CR>'
diffthis
wincmd p
diffthis