Fix calculation of non-floating preview window height

See #775, #846.
This commit is contained in:
Andy Stewart
2022-10-22 17:52:39 +01:00
parent d4a3462df6
commit 400a12081f

View File

@@ -545,9 +545,7 @@ function! s:populate_hunk_preview_window(header, body)
call setline(1, a:body) call setline(1, a:body)
setlocal nomodified setlocal nomodified
normal! G$ let [_, height] = s:screen_lines(a:body)
let hunk_height = max([len(a:body), winline()])
let height = min([hunk_height, &previewheight])
execute 'resize' height execute 'resize' height
1 1