From 9756e95bd596a303946a90f06f4efe51dcd57e87 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Tue, 13 Apr 2021 15:18:27 +0100 Subject: [PATCH] Fix resizing of existing non-floating hunk preview window This bug was introduced by 9784226 in #708. It had the effect of not allowing an existing hunk preview window to increase in size for a larger hunk (up to 'previewheight'). See #775. --- autoload/gitgutter/hunk.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/gitgutter/hunk.vim b/autoload/gitgutter/hunk.vim index eccf655..8ea6b24 100644 --- a/autoload/gitgutter/hunk.vim +++ b/autoload/gitgutter/hunk.vim @@ -547,7 +547,8 @@ function! s:populate_hunk_preview_window(header, body) setlocal nomodified normal! G$ - let height = min([winline(), &previewheight]) + let hunk_height = max([body_length, winline()]) + let height = min([hunk_height, &previewheight]) execute 'resize' height 1