patch 8.2.1966: popup becomes current window after closing a terminal window
Problem: Popup becomes current window after closing a terminal window.
Solution: When restoring the window after executing autocommands, check that
the window ID is still the same. (Naruhiko Nishino,
closes #7272)
diff --git a/src/structs.h b/src/structs.h
index 330bb53..90e7620 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -3889,13 +3889,13 @@
*/
typedef struct
{
- buf_T *save_curbuf; // saved curbuf
- int use_aucmd_win; // using aucmd_win
- win_T *save_curwin; // saved curwin
- win_T *new_curwin; // new curwin
- win_T *save_prevwin; // saved prevwin
- bufref_T new_curbuf; // new curbuf
- char_u *globaldir; // saved value of globaldir
+ buf_T *save_curbuf; // saved curbuf
+ int use_aucmd_win; // using aucmd_win
+ int save_curwin_id; // ID of saved curwin
+ int new_curwin_id; // ID of new curwin
+ int save_prevwin_id; // ID of saved prevwin
+ bufref_T new_curbuf; // new curbuf
+ char_u *globaldir; // saved value of globaldir
} aco_save_T;
/*