comparison src/popupwin.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
comparison
equal deleted inserted replaced
16795:39a8595200a6 16796:5f98d80d116a
83 83
84 nr = (int)dict_get_number(d, (char_u *)"tab"); 84 nr = (int)dict_get_number(d, (char_u *)"tab");
85 if (nr == 0) 85 if (nr == 0)
86 { 86 {
87 // popup on current tab 87 // popup on current tab
88 wp->w_next = first_tab_popupwin; 88 wp->w_next = curtab->tp_first_popupwin;
89 first_tab_popupwin = wp; 89 curtab->tp_first_popupwin = wp;
90 } 90 }
91 else if (nr < 0) 91 else if (nr < 0)
92 { 92 {
93 // global popup 93 // global popup
94 wp->w_next = first_popupwin; 94 wp->w_next = first_popupwin;
210 */ 210 */
211 void 211 void
212 popup_close_tabpage(tabpage_T *tp, int id) 212 popup_close_tabpage(tabpage_T *tp, int id)
213 { 213 {
214 win_T *wp; 214 win_T *wp;
215 win_T **root; 215 win_T **root = &tp->tp_first_popupwin;
216 win_T *prev = NULL; 216 win_T *prev = NULL;
217 217
218 if (tp == curtab)
219 root = &first_tab_popupwin;
220 else
221 root = &tp->tp_first_popupwin;
222 for (wp = *root; wp != NULL; prev = wp, wp = wp->w_next) 218 for (wp = *root; wp != NULL; prev = wp, wp = wp->w_next)
223 if (wp->w_id == id) 219 if (wp->w_id == id)
224 { 220 {
225 if (prev == NULL) 221 if (prev == NULL)
226 *root = wp->w_next; 222 *root = wp->w_next;
235 void 231 void
236 close_all_popups(void) 232 close_all_popups(void)
237 { 233 {
238 while (first_popupwin != NULL) 234 while (first_popupwin != NULL)
239 popup_close(first_popupwin->w_id); 235 popup_close(first_popupwin->w_id);
240 while (first_tab_popupwin != NULL) 236 while (curtab->tp_first_popupwin != NULL)
241 popup_close(first_tab_popupwin->w_id); 237 popup_close(curtab->tp_first_popupwin->w_id);
242 } 238 }
243 239
244 void 240 void
245 ex_popupclear(exarg_T *eap UNUSED) 241 ex_popupclear(exarg_T *eap UNUSED)
246 { 242 {