aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/globals.h
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-29 21:07:29 +0800
committerGitHub <noreply@github.com>2022-11-29 21:07:29 +0800
commitd311c5481dede47d752fa39cb00d728ba18ef5bc (patch)
treedd2c01f384b4c3713a1d9c5b976cd7c0f8c91fcd /src/nvim/globals.h
parent89f0987bde8124f8fcbbcbf8320dbdabe0d69ba9 (diff)
parent95f5cf96912727a1ede055211645ac9779f3da44 (diff)
downloadrneovim-d311c5481dede47d752fa39cb00d728ba18ef5bc.tar.gz
rneovim-d311c5481dede47d752fa39cb00d728ba18ef5bc.tar.bz2
rneovim-d311c5481dede47d752fa39cb00d728ba18ef5bc.zip
Merge pull request #21234 from zeertzjq/vim-9.0.0965
vim-patch:9.0.{0965,0966,0967}: using one window for executing autocommands is insufficient
Diffstat (limited to 'src/nvim/globals.h')
-rw-r--r--src/nvim/globals.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 737c92bc8c..9b4ef66b14 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -422,8 +422,19 @@ 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.
+enum { AUCMD_WIN_COUNT = 5, };
+
+typedef struct {
+ win_T *auc_win; ///< Window used in aucmd_prepbuf(). When not NULL the
+ ///< window has been allocated.
+ bool auc_win_used; ///< This auc_win is being used.
+} aucmdwin_T;
+
+EXTERN aucmdwin_T aucmd_win[AUCMD_WIN_COUNT];
// The window layout is kept in a tree of frames. topframe points to the top
// of the tree.