patch 9.1.0380: Calculating line height for unnecessary amount of lines
Problem: Calculating line height for unnecessary amount of lines with
half-page scrolling (zhscn, after 9.1.0280)
Solution: Replace "limit_winheight" argument with higher resolution
"max" argument to which to limit the calculated line height
in plines_m_win() to (Luuk van Baal)
fixes: #14650
closes: #14652
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/popupwin.c b/src/popupwin.c
index 25bb153..38c1c9e 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -654,8 +654,8 @@
wp->w_topline = wp->w_buffer->b_ml.ml_line_count;
while (wp->w_topline < wp->w_cursor.lnum
&& wp->w_topline < wp->w_buffer->b_ml.ml_line_count
- && plines_m_win(wp, wp->w_topline, wp->w_cursor.lnum, FALSE)
- > wp->w_height)
+ && plines_m_win(wp, wp->w_topline, wp->w_cursor.lnum,
+ wp->w_height + 1) > wp->w_height)
++wp->w_topline;
}