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:
24
src/window.c
24
src/window.c
@@ -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;
|
||||
|
Reference in New Issue
Block a user