1
0
forked from aniani/vim

patch 8.1.1832: win_execute() does not work in other tab

Problem:    Win_execute() does not work in other tab. (Rick Howe)
Solution:   Take care of the tab. (closes #4792)
This commit is contained in:
Bram Moolenaar
2019-08-09 14:56:22 +02:00
parent 2514315fc2
commit 820680b9ff
5 changed files with 40 additions and 4 deletions

View File

@@ -6887,24 +6887,48 @@ win_id2tabwin(typval_T *argvars, list_T *list)
list_append_number(list, 0);
}
/*
* Return the window pointer of window "id".
*/
win_T *
win_id2wp(int id)
{
return win_id2wp_tp(id, NULL);
}
/*
* Return the window and tab pointer of window "id".
*/
win_T *
win_id2wp_tp(int id, tabpage_T **tpp)
{
win_T *wp;
tabpage_T *tp;
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_id == id)
{
if (tpp != NULL)
*tpp = tp;
return wp;
}
#ifdef FEAT_TEXT_PROP
// popup windows are in separate lists
FOR_ALL_TABPAGES(tp)
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
if (wp->w_id == id)
{
if (tpp != NULL)
*tpp = tp;
return wp;
}
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
if (wp->w_id == id)
{
if (tpp != NULL)
*tpp = tp;
return wp;
}
#endif
return NULL;