Mercurial > vim
diff src/window.c @ 16796:5f98d80d116a v8.1.1400
patch 8.1.1400: using global pointer for tab-local popups is clumsy
commit https://github.com/vim/vim/commit/9c27b1c6d140ca824a78654c1cb70a43a69b4ec6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 26 18:48:13 2019 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 May 2019 19:00:04 +0200 |
parents | ddfa924df50d |
children | 12e3a3afdb6a |
line wrap: on
line diff
--- a/src/window.c +++ b/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);