aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
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/ex_cmds2.c
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/ex_cmds2.c')
-rw-r--r--src/nvim/ex_cmds2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index b6489e97b2..d3c0c417e1 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -683,8 +683,10 @@ void ex_listdo(exarg_T *eap)
curbuf);
} else {
aucmd_prepbuf(&aco, buf);
- apply_autocmds(EVENT_SYNTAX, buf->b_p_syn, buf->b_fname, true, buf);
- aucmd_restbuf(&aco);
+ if (curbuf == buf) {
+ apply_autocmds(EVENT_SYNTAX, buf->b_p_syn, buf->b_fname, true, buf);
+ aucmd_restbuf(&aco);
+ }
}
// start over, in case autocommands messed things up.