Patch 9.0.0051
Problem: Using CTRL-C wih :append may hang Vim.
Solution: Reset got_int. (closes #10729, closes #10728)
Files: src/ex_getln.c, src/testdir/test_ex_mode.vim
*** ../vim-9.0.0050/src/ex_getln.c 2022-06-22 18:12:30.000000000 +0100
--- src/ex_getln.c 2022-07-14 17:05:15.765064221 +0100
***************
*** 1786,1791 ****
--- 1786,1793 ----
// that occurs while typing a command should
// cause the command not to be executed.
+ got_int = FALSE; // avoid infinite Ctrl-C loop in Ex mode
+
// Trigger SafeState if nothing is pending.
may_trigger_safestate(xpc.xp_numfiles <= 0);
*** ../vim-9.0.0050/src/testdir/test_ex_mode.vim 2022-06-14 17:12:14.000000000 +0100
--- src/testdir/test_ex_mode.vim 2022-07-14 17:03:07.873238881 +0100
***************
*** 145,150 ****
--- 145,173 ----
bwipe!
endfunc
+ " Test for pressing Ctrl-C in :append inside a loop in Ex mode
+ " This used to hang Vim
+ func Test_Ex_append_in_loop()
+ CheckRunVimInTerminal
+ let buf = RunVimInTerminal('', {'rows': 6})
+
+ call term_sendkeys(buf, "gQ")
+ call term_sendkeys(buf, "for i in range(1)\<CR>")
+ call term_sendkeys(buf, "append\<CR>")
+ call WaitForAssert({-> assert_match(': append', term_getline(buf, 5))}, 1000)
+ call term_sendkeys(buf, "\<C-C>")
+ call term_wait(buf)
+ call term_sendkeys(buf, "foo\<CR>")
+ call WaitForAssert({-> assert_match('foo', term_getline(buf, 5))}, 1000)
+ call term_sendkeys(buf, ".\<CR>")
+ call WaitForAssert({-> assert_match('.', term_getline(buf, 5))}, 1000)
+ call term_sendkeys(buf, "endfor\<CR>")
+ call term_sendkeys(buf, "vi\<CR>")
+ call WaitForAssert({-> assert_match('foo', term_getline(buf, 1))}, 1000)
+
+ call StopVimInTerminal(buf)
+ endfunc
+
" In Ex-mode, a backslash escapes a newline
func Test_Ex_escape_enter()
call feedkeys("gQlet l = \"a\\\<kEnter>b\"\<cr>vi\<cr>", 'xt')
*** ../vim-9.0.0050/src/version.c 2022-07-12 17:34:25.105070059 +0100
--- src/version.c 2022-07-14 17:02:16.909311159 +0100
***************
*** 737,738 ****
--- 737,740 ----
{ /* Add new patch number below this line */
+ /**/
+ 51,
/**/
--
From "know your smileys":
<<<:-{ Worf (Never smiles anyways, so he's a bad smiley)
/// Bram Moolenaar -- Br...@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 ///