From 4a94b374d04dcca015d24b040baf1aee8022ed2b Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 29 Jun 2019 20:50:14 -0400 Subject: [PATCH] Fix bug revealing next hunk --- autoload/fugitive.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 4813df6..c696f5c 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2299,7 +2299,7 @@ function! s:StageReveal(...) abort while getline(end) =~# '^[ \+-]' let end += 1 endwhile - while line('w$') > line('$') && end > line('w$') && line('.') > line('w0') + &scrolloff + while line('w$') < line('$') && end > line('w$') && line('.') > line('w0') + &scrolloff execute "normal! \" endwhile endif @@ -2536,6 +2536,7 @@ function! s:StageDelete(lnum, count) abort call s:TreeChomp('checkout', 'HEAD^{}', '--', info.paths[0]) endif exe s:ReloadStatus() + call s:StageReveal() let @@ = hash return 'checktime|redraw|echomsg ' . \ string('To restore, :Git cat-file blob '.hash[0:6].' > '.info.paths[0])