diff src/popupwin.c @ 28778:a8c2bd5fc727 v8.2.4913

patch 8.2.4913: popup_hide() does not always have effect Commit: https://github.com/vim/vim/commit/27724251bc73f97b55240731f4316ee1b4eac1c5 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 8 15:00:04 2022 +0100 patch 8.2.4913: popup_hide() does not always have effect Problem: Popup_hide() does not always have effect. Solution: Add the POPF_HIDDEN_FORCE flag. (closes https://github.com/vim/vim/issues/10376)
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 May 2022 16:15:05 +0200
parents f59db757e4ef
children 361b46a07f5e
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -978,7 +978,7 @@ apply_options(win_T *wp, dict_T *dict, i
 
     nr = dict_get_bool(dict, (char_u *)"hidden", FALSE);
     if (nr > 0)
-	wp->w_popup_flags |= POPF_HIDDEN;
+	wp->w_popup_flags |= POPF_HIDDEN | POPF_HIDDEN_FORCE;
 
     // when "firstline" and "cursorline" are both set and the cursor would be
     // above or below the displayed lines, move the cursor to "firstline".
@@ -2644,7 +2644,10 @@ f_popup_hide(typval_T *argvars, typval_T
     id = (int)tv_get_number(argvars);
     wp = find_popup_win(id);
     if (wp != NULL)
+    {
 	popup_hide(wp);
+	wp->w_popup_flags |= POPF_HIDDEN_FORCE;
+    }
 }
 
     void
@@ -2674,6 +2677,7 @@ f_popup_show(typval_T *argvars, typval_T
     wp = find_popup_win(id);
     if (wp != NULL)
     {
+	wp->w_popup_flags &= ~POPF_HIDDEN_FORCE;
 	popup_show(wp);
 #ifdef FEAT_QUICKFIX
 	if (wp->w_popup_flags & POPF_INFO)
@@ -3606,8 +3610,9 @@ check_popup_unhidden(win_T *wp)
 	textprop_T  prop;
 	linenr_T    lnum;
 
-	if (find_visible_prop(wp->w_popup_prop_win,
-		    wp->w_popup_prop_type, wp->w_popup_prop_id,
+	if ((wp->w_popup_flags & POPF_HIDDEN_FORCE) == 0
+		&& find_visible_prop(wp->w_popup_prop_win,
+				    wp->w_popup_prop_type, wp->w_popup_prop_id,
 							   &prop, &lnum) == OK)
 	{
 	    wp->w_popup_flags &= ~POPF_HIDDEN;