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.
This commit is contained in:
Andy Stewart
2021-04-13 15:18:27 +01:00
parent 24cc477895
commit 9756e95bd5

View File

@@ -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