summaryrefslogtreecommitdiffstats
path: root/src/globals.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-28 18:51:43 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-28 18:51:43 +0000
commite76062c078debed0df818f70e4db14ad7a7cb53a (patch)
treee43b3b076fdea909c460219e896237a8924ccb6b /src/globals.h
parent74a694dbe20bb7dea4e06f474cf62e20f9c92f1d (diff)
patch 9.0.0965: using one window for executing autocommands is insufficientv9.0.0965
Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands.
Diffstat (limited to 'src/globals.h')
-rw-r--r--src/globals.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/globals.h b/src/globals.h
index d9207b940f..eadff43c99 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -977,8 +977,18 @@ EXTERN win_T *prevwin INIT(= NULL); // previous window
EXTERN win_T *curwin; // currently active window
-EXTERN win_T *aucmd_win; // window used in aucmd_prepbuf()
-EXTERN int aucmd_win_used INIT(= FALSE); // aucmd_win is being used
+// When executing autocommands for a buffer that is not in any window, a
+// special window is created to handle the side effects. When autocommands
+// nest we may need more than one. Allow for up to five, if more are needed
+// something crazy is happening.
+#define AUCMD_WIN_COUNT 5
+
+typedef struct {
+ win_T *auc_win; // window used in aucmd_prepbuf()
+ int auc_win_used; // this auc_win is being used
+} aucmdwin_T;
+
+EXTERN aucmdwin_T aucmd_win[AUCMD_WIN_COUNT];
#ifdef FEAT_PROP_POPUP
EXTERN win_T *first_popupwin; // first global popup window