diff src/window.c @ 17670:1be29c149103 v8.1.1832

patch 8.1.1832: win_execute() does not work in other tab commit https://github.com/vim/vim/commit/820680b9ff1de8699156c7b060f97e5c0b87ad15 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 9 14:56:22 2019 +0200 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 https://github.com/vim/vim/issues/4792)
author Bram Moolenaar <Bram@vim.org>
date Fri, 09 Aug 2019 15:00:05 +0200
parents 711db62c8aca
children 0f7ae8010787
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -6887,24 +6887,48 @@ win_id2tabwin(typval_T *argvars, list_T 
     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;