0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.1400: using global pointer for tab-local popups is clumsy

Problem:    Using global pointer for tab-local popups is clumsy.
Solution:   Use the pointer in tabpage_T.
This commit is contained in:
Bram Moolenaar
2019-05-26 18:48:13 +02:00
parent ec58384afa
commit 9c27b1c6d1
6 changed files with 17 additions and 49 deletions

View File

@@ -85,8 +85,8 @@ f_popup_create(typval_T *argvars, typval_T *rettv)
if (nr == 0)
{
// popup on current tab
wp->w_next = first_tab_popupwin;
first_tab_popupwin = wp;
wp->w_next = curtab->tp_first_popupwin;
curtab->tp_first_popupwin = wp;
}
else if (nr < 0)
{
@@ -212,13 +212,9 @@ popup_close(int id)
popup_close_tabpage(tabpage_T *tp, int id)
{
win_T *wp;
win_T **root;
win_T **root = &tp->tp_first_popupwin;
win_T *prev = NULL;
if (tp == curtab)
root = &first_tab_popupwin;
else
root = &tp->tp_first_popupwin;
for (wp = *root; wp != NULL; prev = wp, wp = wp->w_next)
if (wp->w_id == id)
{
@@ -237,8 +233,8 @@ close_all_popups(void)
{
while (first_popupwin != NULL)
popup_close(first_popupwin->w_id);
while (first_tab_popupwin != NULL)
popup_close(first_tab_popupwin->w_id);
while (curtab->tp_first_popupwin != NULL)
popup_close(curtab->tp_first_popupwin->w_id);
}
void