From e76062c078debed0df818f70e4db14ad7a7cb53a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 28 Nov 2022 18:51:43 +0000 Subject: 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. --- src/ex_cmds2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/ex_cmds2.c') diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index c13d354bc1..9c00b80b7a 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -705,9 +705,12 @@ ex_listdo(exarg_T *eap) else { aucmd_prepbuf(&aco, buf); - apply_autocmds(EVENT_SYNTAX, buf->b_p_syn, + if (curbuf == buf) + { + apply_autocmds(EVENT_SYNTAX, buf->b_p_syn, buf->b_fname, TRUE, buf); - aucmd_restbuf(&aco); + aucmd_restbuf(&aco); + } } // start over, in case autocommands messed things up. -- cgit v1.2.3