summaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/term.c b/src/term.c
index 237a3258ae..b8869f9be8 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2232,10 +2232,13 @@ set_termname(char_u *term)
if (curbuf->b_ml.ml_mfp != NULL)
{
aucmd_prepbuf(&aco, buf);
- apply_autocmds(EVENT_TERMCHANGED, NULL, NULL, FALSE,
+ if (curbuf == buf)
+ {
+ apply_autocmds(EVENT_TERMCHANGED, NULL, NULL, FALSE,
curbuf);
- // restore curwin/curbuf and a few other things
- aucmd_restbuf(&aco);
+ // restore curwin/curbuf and a few other things
+ aucmd_restbuf(&aco);
+ }
}
}
}