Prompt user to choose hunk when overlapping.

See #556.
This commit is contained in:
Andy Stewart
2018-10-18 15:39:55 +01:00
parent 4bd95abe6a
commit 0597380f6b
3 changed files with 73 additions and 1 deletions

View File

@@ -455,6 +455,42 @@ function Test_undo_nearby_hunk()
endfunction
function Test_overlapping_hunk_op()
func Answer(char)
call feedkeys(a:char."\<CR>")
endfunc
" Undo upper
execute '3d'
execute '1d'
call s:trigger_gitgutter()
normal gg
call timer_start(100, {-> Answer('u')} )
GitGutterUndoHunk
call s:trigger_gitgutter()
let expected = [
\ 'line=2 id=3000 name=GitGutterLineRemoved',
\ ]
call assert_equal(expected, s:signs('fixture.txt'))
" Undo lower
execute '1d'
call s:trigger_gitgutter()
normal gg
call timer_start(100, {-> Answer('l')} )
GitGutterUndoHunk
call s:trigger_gitgutter()
let expected = [
\ 'line=1 id=3000 name=GitGutterLineRemovedFirstLine',
\ ]
call assert_equal(expected, s:signs('fixture.txt'))
endfunction
function Test_write_option()
set nowrite