diff src/popupwin.c @ 30220:088a3715ea69 v9.0.0446

patch 9.0.0446: message window may be positioned too low Commit: https://github.com/vim/vim/commit/87e74d0e03c6c0267546b2e3a49316f3e84d9794 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 11 20:12:15 2022 +0100 patch 9.0.0446: message window may be positioned too low Problem: Message window may be positioned too low. Solution: Compute cmdline_row before computing the position.
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Sep 2022 21:15:03 +0200
parents c4af016733fe
children b871016ea7c1
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -1301,9 +1301,14 @@ popup_adjust_position(win_T *wp)
 		wp->w_winrow = Rows - 1;
 	}
 	if (wp->w_popup_pos == POPPOS_BOTTOM)
-	    // assume that each buffer line takes one screen line
+	{
+	    // Assume that each buffer line takes one screen line, and one line
+	    // for the top border.  First make sure cmdline_row is valid,
+	    // calling update_screen() will set it only later.
+	    compute_cmdrow();
 	    wp->w_winrow = MAX(cmdline_row
 				    - wp->w_buffer->b_ml.ml_line_count - 1, 0);
+	}
 
 	if (!use_wantcol)
 	    center_hor = TRUE;