Add shortcuts for getting hunks from other views of the diff. (#801)
Fixes #798
This commit is contained in:
parent
58ed86e434
commit
b3a8be6975
@ -1776,13 +1776,17 @@ function! s:Diff(vert,keepfocus,...) abort
|
|||||||
let nr = bufnr('')
|
let nr = bufnr('')
|
||||||
execute 'leftabove '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`'
|
execute 'leftabove '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`'
|
||||||
execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
|
execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
|
||||||
|
let nr2 = bufnr('')
|
||||||
call s:diffthis()
|
call s:diffthis()
|
||||||
wincmd p
|
wincmd p
|
||||||
execute 'rightbelow '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`'
|
execute 'rightbelow '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`'
|
||||||
execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
|
execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
|
||||||
|
let nr3 = bufnr('')
|
||||||
call s:diffthis()
|
call s:diffthis()
|
||||||
wincmd p
|
wincmd p
|
||||||
call s:diffthis()
|
call s:diffthis()
|
||||||
|
execute 'nnoremap <buffer> <silent> d2o :diffget '.nr2.'<Bar>diffupdate<CR>'
|
||||||
|
execute 'nnoremap <buffer> <silent> d3o :diffget '.nr3.'<Bar>diffupdate<CR>'
|
||||||
return post
|
return post
|
||||||
elseif len(args)
|
elseif len(args)
|
||||||
let arg = join(args, ' ')
|
let arg = join(args, ' ')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user