summaryrefslogtreecommitdiffstats
path: root/src/popupwin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/popupwin.c')
-rw-r--r--src/popupwin.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index 68ec64a2df..0cccf4ae83 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -28,6 +28,11 @@ static poppos_entry_T poppos_entries[] = {
{"center", POPPOS_CENTER}
};
+#ifdef HAS_MESSAGE_WINDOW
+// Window used for messages when 'winheight' is zero.
+static win_T *message_win = NULL;
+#endif
+
static void popup_adjust_position(win_T *wp);
/*
@@ -2770,6 +2775,11 @@ popup_free(win_T *wp)
clear_cmdline = TRUE;
win_free_popup(wp);
+#ifdef HAS_MESSAGE_WINDOW
+ if (wp == message_win)
+ message_win = NULL;
+#endif
+
redraw_all_later(UPD_NOT_VALID);
popup_mask_refresh = TRUE;
}
@@ -4440,9 +4450,6 @@ popup_close_info(void)
#if defined(HAS_MESSAGE_WINDOW) || defined(PROTO)
-// Window used for messages when 'winheight' is zero.
-static win_T *message_win = NULL;
-
/*
* Get the message window.
* Returns NULL if something failed.
@@ -4516,6 +4523,16 @@ popup_hide_message_win(void)
popup_hide(message_win);
}
+/*
+ * If the message window exists: close it.
+ */
+ void
+popup_close_message_win(void)
+{
+ if (message_win != NULL)
+ popup_close(message_win->w_id, TRUE);
+}
+
#endif
/*