diff src/popupwin.c @ 23897:3033dade50ca v8.2.2491

patch 8.2.2491: popup window for text property may show in first screen line Commit: https://github.com/vim/vim/commit/82db31c10470b0e27d7039d15c32ed7e9417cc02 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 10 14:56:11 2021 +0100 patch 8.2.2491: popup window for text property may show in first screen line Problem: Popup window for text property may show in first screen line. Solution: If the text position is invisible do not show the popup window. (closes #7807)
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Feb 2021 15:00:04 +0100
parents 5a4f9c5c1b99
children a0e02766e06d
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -1193,6 +1193,12 @@ popup_adjust_position(win_T *wp)
 	textpos2screenpos(prop_win, &pos, &screen_row,
 				     &screen_scol, &screen_ccol, &screen_ecol);
 
+	if (screen_scol == 0)
+	{
+	    // position is off screen, make the width zero to hide it.
+	    wp->w_width = 0;
+	    return;
+	}
 	if (wp->w_popup_pos == POPPOS_TOPLEFT
 		|| wp->w_popup_pos == POPPOS_TOPRIGHT)
 	    // below the text