diff src/popupwin.c @ 17245:13a2d3364b3f v8.1.1622

patch 8.1.1622: wrong width if displaying a lot of lines in a popup window commit https://github.com/vim/vim/commit/e296e3177b67bdcaa8b1f144d2495b9413e7055c Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 3 23:20:18 2019 +0200 patch 8.1.1622: wrong width if displaying a lot of lines in a popup window Problem: Wrong width if displaying a lot of lines in a popup window. Solution: Accurately compute the line overflow.
author Bram Moolenaar <Bram@vim.org>
date Wed, 03 Jul 2019 23:30:07 +0200
parents 3ada3d207b33
children 6a7ba68d448e
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -855,8 +855,8 @@ popup_adjust_position(win_T *wp)
 	if (wp->w_width < len)
 	    wp->w_width = len;
 	// do not use the width of lines we're not going to show
-	if (wp->w_maxheight > 0 && wp->w_buffer->b_ml.ml_line_count
-			       - wp->w_topline + 1 + wrapped > wp->w_maxheight)
+	if (wp->w_maxheight > 0
+		       && lnum - wp->w_topline + 1 + wrapped > wp->w_maxheight)
 	    break;
     }