summaryrefslogtreecommitdiffstats
path: root/src/ex_getln.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r--src/ex_getln.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index f2a960e234..e20842b645 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4494,8 +4494,9 @@ open_cmdwin(void)
// Don't let quitting the More prompt make this fail.
got_int = FALSE;
- // Set "cmdwin_type" before any autocommands may mess things up.
+ // Set "cmdwin_..." variables before any autocommands may mess things up.
cmdwin_type = get_cmdline_type();
+ cmdwin_win = curwin;
// Create the command-line buffer empty.
if (do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL) == FAIL)
@@ -4504,8 +4505,10 @@ open_cmdwin(void)
win_close(curwin, TRUE);
ga_clear(&winsizes);
cmdwin_type = 0;
+ cmdwin_win = NULL;
return Ctrl_C;
}
+ cmdwin_buf = curbuf;
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
(void)setfname(curbuf, (char_u *)_("[Command Line]"), NULL, TRUE);
@@ -4615,6 +4618,8 @@ open_cmdwin(void)
# endif
cmdwin_type = 0;
+ cmdwin_buf = NULL;
+ cmdwin_win = NULL;
exmode_active = save_exmode;
// Safety check: The old window or buffer was deleted: It's a bug when