To: vim_dev@googlegroups.com Subject: Patch 8.2.4672 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4672 Problem: Using :normal with Ex mode may make :substitute hang. Solution: When getting an empty line behave like 'q' was typed. (closes #10070) Files: src/ex_cmds.c, src/testdir/test_normal.vim *** ../vim-8.2.4671/src/ex_cmds.c 2022-03-31 11:37:54.259367941 +0100 --- src/ex_cmds.c 2022-04-03 12:58:35.574383548 +0100 *************** *** 4233,4238 **** --- 4233,4243 ---- { typed = *resp; vim_free(resp); + // When ":normal" runs out of characters we get + // an empty line. Use "q" to get out of the + // loop. + if (ex_normal_busy && typed == NUL) + typed = 'q'; } } else *** ../vim-8.2.4671/src/testdir/test_normal.vim 2022-02-12 20:34:47.088825181 +0000 --- src/testdir/test_normal.vim 2022-04-03 12:57:39.374373201 +0100 *************** *** 2641,2646 **** --- 2641,2655 ---- bw! endfunc + func Test_normal_ex_substitute() + " This was hanging on the substitute prompt. + new + call setline(1, 'a') + exe "normal! gggQs/a/b/c\" + call assert_equal('a', getline(1)) + bwipe! + endfunc + " Test for g CTRL-G func Test_g_ctrl_g() new *** ../vim-8.2.4671/src/version.c 2022-04-03 11:58:28.014196270 +0100 --- src/version.c 2022-04-03 12:59:23.350391540 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4672, /**/ -- I bought a book on hair loss, but the pages kept falling out. /// 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 ///