forked from aniani/vim
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:
30
src/window.c
30
src/window.c
@@ -1371,7 +1371,7 @@ win_valid_popup(win_T *win UNUSED)
|
||||
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
|
||||
if (wp == win)
|
||||
return TRUE;
|
||||
for (wp = first_tab_popupwin; wp != NULL; wp = wp->w_next)
|
||||
for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next)
|
||||
if (wp == win)
|
||||
return TRUE;
|
||||
#endif
|
||||
@@ -3673,13 +3673,8 @@ free_tabpage(tabpage_T *tp)
|
||||
{
|
||||
win_T *wp;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
wp = tp == curtab ? first_tab_popupwin : tp->tp_first_popupwin;
|
||||
if (wp == NULL)
|
||||
break;
|
||||
popup_close_tabpage(tp, wp->w_id);
|
||||
}
|
||||
while (tp->tp_first_popupwin != NULL)
|
||||
popup_close_tabpage(tp, tp->tp_first_popupwin->w_id);
|
||||
}
|
||||
#endif
|
||||
for (idx = 0; idx < SNAP_COUNT; ++idx)
|
||||
@@ -3973,10 +3968,6 @@ leave_tabpage(
|
||||
tp->tp_prevwin = prevwin;
|
||||
tp->tp_firstwin = firstwin;
|
||||
tp->tp_lastwin = lastwin;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
tp->tp_first_popupwin = first_tab_popupwin;
|
||||
first_tab_popupwin = NULL;
|
||||
#endif
|
||||
tp->tp_old_Rows = Rows;
|
||||
tp->tp_old_Columns = Columns;
|
||||
firstwin = NULL;
|
||||
@@ -4004,9 +3995,6 @@ enter_tabpage(
|
||||
firstwin = tp->tp_firstwin;
|
||||
lastwin = tp->tp_lastwin;
|
||||
topframe = tp->tp_topframe;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
first_tab_popupwin = tp->tp_first_popupwin;
|
||||
#endif
|
||||
|
||||
/* We would like doing the TabEnter event first, but we don't have a
|
||||
* valid current window yet, which may break some commands.
|
||||
@@ -6513,15 +6501,9 @@ switch_win(
|
||||
{
|
||||
curtab->tp_firstwin = firstwin;
|
||||
curtab->tp_lastwin = lastwin;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
curtab->tp_first_popupwin = first_tab_popupwin ;
|
||||
#endif
|
||||
curtab = tp;
|
||||
firstwin = curtab->tp_firstwin;
|
||||
lastwin = curtab->tp_lastwin;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
first_tab_popupwin = curtab->tp_first_popupwin;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
goto_tabpage_tp(tp, FALSE, FALSE);
|
||||
@@ -6550,15 +6532,9 @@ restore_win(
|
||||
{
|
||||
curtab->tp_firstwin = firstwin;
|
||||
curtab->tp_lastwin = lastwin;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
curtab->tp_first_popupwin = first_tab_popupwin ;
|
||||
#endif
|
||||
curtab = save_curtab;
|
||||
firstwin = curtab->tp_firstwin;
|
||||
lastwin = curtab->tp_lastwin;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
first_tab_popupwin = curtab->tp_first_popupwin;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
goto_tabpage_tp(save_curtab, FALSE, FALSE);
|
||||
|
Reference in New Issue
Block a user