patch 8.1.1433: win_execute() may leave popup window focused
Problem: Win_execute() may leave popup window focused, eventually leading
to a crash. (Bjorn Linse)
Solution: When previous window was closed, go to the first window.
diff --git a/src/window.c b/src/window.c
index 07c8780..e73a9f4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6573,6 +6573,12 @@
curwin = save_curwin;
curbuf = curwin->w_buffer;
}
+#ifdef FEAT_TEXT_PROP
+ else if (bt_popup(curwin->w_buffer))
+ // original window was closed and now we're in a popup window: Go
+ // to the first valid window.
+ win_goto(firstwin);
+#endif
}
/*