aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds2.c
diff options
context:
space:
mode:
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.