0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.2413: crash when using :all while using a cmdline window

Problem:    Crash when using :all while using a cmdline window. (Zdenek Dohnal)
Solution:   Disallow :all from the cmdline window.
This commit is contained in:
Bram Moolenaar
2021-01-26 21:35:08 +01:00
parent ce0370d9e6
commit bb4b93ed85
4 changed files with 20 additions and 1 deletions

View File

@@ -4205,6 +4205,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.
cmdwin_type = get_cmdline_type();
// Create the command-line buffer empty.
if (do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL) == FAIL)
{
@@ -4213,7 +4216,6 @@ open_cmdwin(void)
ga_clear(&winsizes);
return Ctrl_C;
}
cmdwin_type = get_cmdline_type();
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
(void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);