aboutsummaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index e3d02357e1..0779568bc8 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2774,6 +2774,11 @@ do_ecmd (
}
buf = buflist_new(ffname, sfname, 0L,
BLN_CURBUF | ((flags & ECMD_SET_HELP) ? 0 : BLN_LISTED));
+ // Autocmds may change curwin and curbuf.
+ if (oldwin != NULL) {
+ oldwin = curwin;
+ }
+ old_curbuf = curbuf;
}
if (buf == NULL)
goto theend;