To: vim_dev@googlegroups.com Subject: Patch 9.0.1665 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1665 Problem: Empty CmdlineEnter autocommand causes errors in Ex mode. Solution: Save and restore ex_pressedreturn. (Christian Brabandt, closes # 12581, closes #12578) Files: src/autocmd.c, src/ex_docmd.c, src/testdir/test_ex_mode.vim *** ../vim-9.0.1664/src/autocmd.c 2023-05-27 14:10:04.315182896 +0100 --- src/autocmd.c 2023-06-25 22:33:32.708529191 +0100 *************** *** 2018,2024 **** int did_save_redobuff = FALSE; save_redo_T save_redo; int save_KeyTyped = KeyTyped; - int save_did_emsg; ESTACK_CHECK_DECLARATION; /* --- 2018,2023 ---- *************** *** 2310,2321 **** else check_lnums_nested(TRUE); ! save_did_emsg = did_emsg; do_cmdline(NULL, getnextac, (void *)&patcmd, DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT); did_emsg += save_did_emsg; if (nesting == 1) // restore cursor and topline, unless they were changed --- 2309,2322 ---- else check_lnums_nested(TRUE); ! int save_did_emsg = did_emsg; ! int save_ex_pressedreturn = get_pressedreturn(); do_cmdline(NULL, getnextac, (void *)&patcmd, DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT); did_emsg += save_did_emsg; + set_pressedreturn(save_ex_pressedreturn); if (nesting == 1) // restore cursor and topline, unless they were changed *** ../vim-9.0.1664/src/ex_docmd.c 2023-05-31 17:12:07.884535632 +0100 --- src/ex_docmd.c 2023-06-25 22:28:08.298329980 +0100 *************** *** 9840,9846 **** } #endif - #if defined(FEAT_TIMERS) || defined(PROTO) int get_pressedreturn(void) { --- 9840,9845 ---- *************** *** 9852,9855 **** { ex_pressedreturn = val; } - #endif --- 9851,9853 ---- *** ../vim-9.0.1664/src/testdir/test_ex_mode.vim 2023-03-07 21:04:58.329770231 +0000 --- src/testdir/test_ex_mode.vim 2023-06-25 22:24:34.039125233 +0100 *************** *** 239,244 **** --- 239,250 ---- au! CmdLineEnter delfunc ExEnterFunc + + au CmdlineEnter * : + call feedkeys("gQecho 1\r", 'xt') + + au! CmdlineEnter + quit endfunc *** ../vim-9.0.1664/src/version.c 2023-06-24 21:57:47.743177847 +0100 --- src/version.c 2023-06-25 22:24:15.507136929 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1665, /**/ -- hundred-and-one symptoms of being an internet addict: 233. You start dreaming about web pages...in html. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///