aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/globals.h
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-29 18:20:11 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-29 20:36:31 +0800
commit3173d07564e7cdf0834099a379f0faf480c76224 (patch)
tree2ced5358c126a6015f0b66a1e015542f039ac29f /src/nvim/globals.h
parent273358651af6b6d172944cd1b1b41a9869d53b10 (diff)
downloadrneovim-3173d07564e7cdf0834099a379f0faf480c76224.tar.gz
rneovim-3173d07564e7cdf0834099a379f0faf480c76224.tar.bz2
rneovim-3173d07564e7cdf0834099a379f0faf480c76224.zip
vim-patch:9.0.0965: using one window for executing autocommands is insufficient
Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands. https://github.com/vim/vim/commit/e76062c078debed0df818f70e4db14ad7a7cb53a N/A patches for version.c: vim-patch:9.0.0966: some compilers don't allow a declaration after a label Problem: Some compilers don't allow a declaration after a label. Solution: Move the declaration to the start of the block. (John Marriott) https://github.com/vim/vim/commit/f86490ed4fdab213a28f667abd055c023a73d645 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/globals.h')
-rw-r--r--src/nvim/globals.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 737c92bc8c..feeaae1d7f 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -422,8 +422,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.
+enum { 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];
// The window layout is kept in a tree of frames. topframe points to the top
// of the tree.