From 400a12081f188f3fb639f8f962456764f39c6ff1 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Sat, 22 Oct 2022 17:52:39 +0100 Subject: [PATCH] Fix calculation of non-floating preview window height See #775, #846. --- autoload/gitgutter/hunk.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/autoload/gitgutter/hunk.vim b/autoload/gitgutter/hunk.vim index a8aaa5a..7eabf8f 100644 --- a/autoload/gitgutter/hunk.vim +++ b/autoload/gitgutter/hunk.vim @@ -545,9 +545,7 @@ function! s:populate_hunk_preview_window(header, body) call setline(1, a:body) setlocal nomodified - normal! G$ - let hunk_height = max([len(a:body), winline()]) - let height = min([hunk_height, &previewheight]) + let [_, height] = s:screen_lines(a:body) execute 'resize' height 1