Patch 8.2.0274
Problem:    Hang with combination of feedkeys(), Ex mode and :global.
            (Yegappan Lakshmanan)
Solution:   Add the pending_exmode_active flag.
Files:      src/ex_docmd.c, src/globals.h, src/getchar.c,
            src/testdir/test_ex_mode.vim


*** ../vim-8.2.0273/src/ex_docmd.c      2020-02-16 16:18:45.657781422 +0100
--- src/ex_docmd.c      2020-02-18 21:31:14.194639070 +0100
***************
*** 6185,6193 ****
--- 6185,6195 ----
                hold_gui_events = 0;
  #endif
                must_redraw = CLEAR;
+               pending_exmode_active = TRUE;
  
                main_loop(FALSE, TRUE);
  
+               pending_exmode_active = FALSE;
                RedrawingDisabled = rd;
                no_wait_return = nwr;
                msg_scroll = ms;
*** ../vim-8.2.0273/src/globals.h       2020-02-12 22:25:22.209551039 +0100
--- src/globals.h       2020-02-18 21:32:26.646425717 +0100
***************
*** 1028,1033 ****
--- 1028,1037 ----
   * Ex mode (Q) state
   */
  EXTERN int exmode_active INIT(= 0);   // zero, EXMODE_NORMAL or EXMODE_VIM
+ 
+ // Flag set when main_loop() should exit when entering Ex mode.
+ EXTERN int pending_exmode_active INIT(= FALSE);
+ 
  EXTERN int ex_no_reprint INIT(= FALSE); // no need to print after z or p
  
  EXTERN int reg_recording INIT(= 0);   // register for recording  or zero
*** ../vim-8.2.0273/src/getchar.c       2020-01-26 21:59:25.624718145 +0100
--- src/getchar.c       2020-02-18 21:05:43.773290269 +0100
***************
*** 3041,3046 ****
--- 3041,3050 ----
  #ifdef FEAT_CMDWIN
                    tc = c;
  #endif
+                   // return from main_loop()
+                   if (pending_exmode_active)
+                       exmode_active = EXMODE_NORMAL;
+ 
                    break;
                }
  
*** ../vim-8.2.0273/src/testdir/test_ex_mode.vim        2020-02-17 
21:33:26.266098800 +0100
--- src/testdir/test_ex_mode.vim        2020-02-18 21:29:26.210962730 +0100
***************
*** 111,114 ****
--- 111,122 ----
    close!
  endfunc
  
+ func Test_Ex_feedkeys()
+   " this doesn't do anything useful, just check it doesn't hang
+   new
+   call setline(1, ["foo"])
+   call feedkeys("Qg/foo/visual\<CR>", "xt")
+   bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.0273/src/version.c       2020-02-17 22:53:11.489034456 +0100
--- src/version.c       2020-02-18 21:05:52.621270971 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     274,
  /**/

-- 
>From "know your smileys":
 ...---...   SOS

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
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/202002182033.01IKXXaq008813%40masaka.moolenaar.net.

Raspunde prin e-mail lui