diff src/window.c @ 22900:2c1520981e63 v8.2.1997

patch 8.2.1997: window changes when using bufload() while in a terminal popup Commit: https://github.com/vim/vim/commit/8adc8d9b73121b647476a33d91d31d25e1c2d987 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 16 20:47:31 2020 +0100 patch 8.2.1997: window changes when using bufload() while in a terminal popup Problem: Window changes when using bufload() while in a terminal popup. Solution: When searching for a window by ID also find a popup window. (closes #7307)
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Nov 2020 21:00:04 +0100
parents 80bd5de5dcab
children 3105546b941f
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -1462,6 +1462,7 @@ win_valid(win_T *win)
 
 /*
  * Find window "id" in the current tab page.
+ * Also find popup windows.
  * Return NULL if not found.
  */
     win_T *
@@ -1472,6 +1473,14 @@ win_find_by_id(int id)
     FOR_ALL_WINDOWS(wp)
 	if (wp->w_id == id)
 	    return wp;
+#ifdef FEAT_PROP_POPUP
+    FOR_ALL_POPUPWINS(wp)
+	if (wp->w_id == id)
+	    return wp;
+    FOR_ALL_POPUPWINS_IN_TAB(curtab, wp)
+	if (wp->w_id == id)
+	    return wp;
+#endif
     return NULL;
 }