To: vim_dev@googlegroups.com Subject: Patch 8.2.2413 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2413 Problem: Crash when using :all while using a cmdline window. (Zdenek Dohnal) Solution: Disallow :all from the cmdline window. Files: src/arglist.c, src/ex_getln.c, src/testdir/test_arglist.vim *** ../vim-8.2.2412/src/arglist.c 2020-12-21 19:59:04.565197736 +0100 --- src/arglist.c 2021-01-26 21:17:57.043248607 +0100 *************** *** 884,889 **** --- 884,896 ---- win_T *new_curwin = NULL; tabpage_T *new_curtab = NULL; + #ifdef FEAT_CMDWIN + if (cmdwin_type != 0) + { + emsg(_(e_cmdwin)); + return; + } + #endif if (ARGCOUNT <= 0) { // Don't give an error message. We don't want it when the ":all" *** ../vim-8.2.2412/src/ex_getln.c 2021-01-04 12:41:49.503891371 +0100 --- src/ex_getln.c 2021-01-26 21:22:13.038438130 +0100 *************** *** 4205,4210 **** --- 4205,4213 ---- // 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,4219 **** 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); --- 4216,4221 ---- *** ../vim-8.2.2412/src/testdir/test_arglist.vim 2020-12-18 19:49:52.345571854 +0100 --- src/testdir/test_arglist.vim 2021-01-26 21:23:14.734248878 +0100 *************** *** 559,562 **** --- 559,570 ---- call delete('.c.swp') endfunc + " Test for ":all" not working when in the cmdline window + func Test_all_not_allowed_from_cmdwin() + au BufEnter * all + next x + call assert_fails(":norm 7q?x\", 'E11:') + au! BufEnter + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.2412/src/version.c 2021-01-26 19:32:49.743415285 +0100 --- src/version.c 2021-01-26 21:23:44.482158303 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2413, /**/ -- "Marriage is the process of finding out what kind of man your wife would have preferred" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///