Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
16795:39a8595200a6 | 16796:5f98d80d116a |
---|---|
1369 win_T *wp; | 1369 win_T *wp; |
1370 | 1370 |
1371 for (wp = first_popupwin; wp != NULL; wp = wp->w_next) | 1371 for (wp = first_popupwin; wp != NULL; wp = wp->w_next) |
1372 if (wp == win) | 1372 if (wp == win) |
1373 return TRUE; | 1373 return TRUE; |
1374 for (wp = first_tab_popupwin; wp != NULL; wp = wp->w_next) | 1374 for (wp = curtab->tp_first_popupwin; wp != NULL; wp = wp->w_next) |
1375 if (wp == win) | 1375 if (wp == win) |
1376 return TRUE; | 1376 return TRUE; |
1377 #endif | 1377 #endif |
1378 return FALSE; | 1378 return FALSE; |
1379 } | 1379 } |
3671 # endif | 3671 # endif |
3672 # ifdef FEAT_TEXT_PROP | 3672 # ifdef FEAT_TEXT_PROP |
3673 { | 3673 { |
3674 win_T *wp; | 3674 win_T *wp; |
3675 | 3675 |
3676 for (;;) | 3676 while (tp->tp_first_popupwin != NULL) |
3677 { | 3677 popup_close_tabpage(tp, tp->tp_first_popupwin->w_id); |
3678 wp = tp == curtab ? first_tab_popupwin : tp->tp_first_popupwin; | |
3679 if (wp == NULL) | |
3680 break; | |
3681 popup_close_tabpage(tp, wp->w_id); | |
3682 } | |
3683 } | 3678 } |
3684 #endif | 3679 #endif |
3685 for (idx = 0; idx < SNAP_COUNT; ++idx) | 3680 for (idx = 0; idx < SNAP_COUNT; ++idx) |
3686 clear_snapshot(tp, idx); | 3681 clear_snapshot(tp, idx); |
3687 #ifdef FEAT_EVAL | 3682 #ifdef FEAT_EVAL |
3971 #endif | 3966 #endif |
3972 tp->tp_curwin = curwin; | 3967 tp->tp_curwin = curwin; |
3973 tp->tp_prevwin = prevwin; | 3968 tp->tp_prevwin = prevwin; |
3974 tp->tp_firstwin = firstwin; | 3969 tp->tp_firstwin = firstwin; |
3975 tp->tp_lastwin = lastwin; | 3970 tp->tp_lastwin = lastwin; |
3976 #ifdef FEAT_TEXT_PROP | |
3977 tp->tp_first_popupwin = first_tab_popupwin; | |
3978 first_tab_popupwin = NULL; | |
3979 #endif | |
3980 tp->tp_old_Rows = Rows; | 3971 tp->tp_old_Rows = Rows; |
3981 tp->tp_old_Columns = Columns; | 3972 tp->tp_old_Columns = Columns; |
3982 firstwin = NULL; | 3973 firstwin = NULL; |
3983 lastwin = NULL; | 3974 lastwin = NULL; |
3984 return OK; | 3975 return OK; |
4002 | 3993 |
4003 curtab = tp; | 3994 curtab = tp; |
4004 firstwin = tp->tp_firstwin; | 3995 firstwin = tp->tp_firstwin; |
4005 lastwin = tp->tp_lastwin; | 3996 lastwin = tp->tp_lastwin; |
4006 topframe = tp->tp_topframe; | 3997 topframe = tp->tp_topframe; |
4007 #ifdef FEAT_TEXT_PROP | |
4008 first_tab_popupwin = tp->tp_first_popupwin; | |
4009 #endif | |
4010 | 3998 |
4011 /* We would like doing the TabEnter event first, but we don't have a | 3999 /* We would like doing the TabEnter event first, but we don't have a |
4012 * valid current window yet, which may break some commands. | 4000 * valid current window yet, which may break some commands. |
4013 * This triggers autocommands, thus may make "tp" invalid. */ | 4001 * This triggers autocommands, thus may make "tp" invalid. */ |
4014 win_enter_ext(tp->tp_curwin, FALSE, TRUE, FALSE, | 4002 win_enter_ext(tp->tp_curwin, FALSE, TRUE, FALSE, |
6511 *save_curtab = curtab; | 6499 *save_curtab = curtab; |
6512 if (no_display) | 6500 if (no_display) |
6513 { | 6501 { |
6514 curtab->tp_firstwin = firstwin; | 6502 curtab->tp_firstwin = firstwin; |
6515 curtab->tp_lastwin = lastwin; | 6503 curtab->tp_lastwin = lastwin; |
6516 #ifdef FEAT_TEXT_PROP | |
6517 curtab->tp_first_popupwin = first_tab_popupwin ; | |
6518 #endif | |
6519 curtab = tp; | 6504 curtab = tp; |
6520 firstwin = curtab->tp_firstwin; | 6505 firstwin = curtab->tp_firstwin; |
6521 lastwin = curtab->tp_lastwin; | 6506 lastwin = curtab->tp_lastwin; |
6522 #ifdef FEAT_TEXT_PROP | |
6523 first_tab_popupwin = curtab->tp_first_popupwin; | |
6524 #endif | |
6525 } | 6507 } |
6526 else | 6508 else |
6527 goto_tabpage_tp(tp, FALSE, FALSE); | 6509 goto_tabpage_tp(tp, FALSE, FALSE); |
6528 } | 6510 } |
6529 if (!win_valid(win)) | 6511 if (!win_valid(win)) |
6548 { | 6530 { |
6549 if (no_display) | 6531 if (no_display) |
6550 { | 6532 { |
6551 curtab->tp_firstwin = firstwin; | 6533 curtab->tp_firstwin = firstwin; |
6552 curtab->tp_lastwin = lastwin; | 6534 curtab->tp_lastwin = lastwin; |
6553 #ifdef FEAT_TEXT_PROP | |
6554 curtab->tp_first_popupwin = first_tab_popupwin ; | |
6555 #endif | |
6556 curtab = save_curtab; | 6535 curtab = save_curtab; |
6557 firstwin = curtab->tp_firstwin; | 6536 firstwin = curtab->tp_firstwin; |
6558 lastwin = curtab->tp_lastwin; | 6537 lastwin = curtab->tp_lastwin; |
6559 #ifdef FEAT_TEXT_PROP | |
6560 first_tab_popupwin = curtab->tp_first_popupwin; | |
6561 #endif | |
6562 } | 6538 } |
6563 else | 6539 else |
6564 goto_tabpage_tp(save_curtab, FALSE, FALSE); | 6540 goto_tabpage_tp(save_curtab, FALSE, FALSE); |
6565 } | 6541 } |
6566 if (win_valid(save_curwin)) | 6542 if (win_valid(save_curwin)) |