To: vim_dev@googlegroups.com Subject: Patch 8.2.1000 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1000 Problem: Get error when leaving Ex mode with :visual and a CmdLineEnter autocommand was used. Solution: Reset ex_pressedreturn. (closes #6293) Files: src/ex_docmd.c, src/testdir/test_ex_mode.vim *** ../vim-8.2.0999/src/ex_docmd.c 2020-06-05 22:33:38.409658754 +0200 --- src/ex_docmd.c 2020-06-18 17:28:06.821131520 +0200 *************** *** 1895,1901 **** p = ea.cmd; while (ASCII_ISALNUM(*p)) ++p; ! p = vim_strnsave(ea.cmd, (int)(p - ea.cmd)); ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL); vim_free(p); // If the autocommands did something and didn't cause an error, try --- 1895,1901 ---- p = ea.cmd; while (ASCII_ISALNUM(*p)) ++p; ! p = vim_strnsave(ea.cmd, p - ea.cmd); ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL); vim_free(p); // If the autocommands did something and didn't cause an error, try *************** *** 6215,6220 **** --- 6215,6221 ---- || eap->cmdidx == CMD_view)) { exmode_active = FALSE; + ex_pressedreturn = FALSE; if (*eap->arg == NUL) { // Special case: ":global/pat/visual\NLvi-commands" *** ../vim-8.2.0999/src/testdir/test_ex_mode.vim 2020-04-21 22:01:11.093499495 +0200 --- src/testdir/test_ex_mode.vim 2020-06-18 17:27:43.997207749 +0200 *************** *** 166,171 **** --- 166,182 ---- endtry call assert_equal(1, caught_e565) au! InsertCharPre + + new + au CmdLineEnter * call ExEnterFunc() + func ExEnterFunc() + + endfunc + call feedkeys("gQvi\r", 'xt') + + au! CmdLineEnter + delfunc ExEnterFunc + quit endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.0999/src/version.c 2020-06-18 15:33:21.705578661 +0200 --- src/version.c 2020-06-18 17:25:11.753721774 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1000, /**/ -- [SIR LAUNCELOT runs back up the stairs, grabs a rope of the wall and swings out over the heads of the CROWD in a swashbuckling manner towards a large window. He stops just short of the window and is left swing pathetically back and forth.] LAUNCELOT: Excuse me ... could somebody give me a push ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 ///