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\<CR>"
+   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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220403120024.D76B11C0561%40moolenaar.net.

Raspunde prin e-mail lui