0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.0274: hang with combination of feedkeys(), Ex mode and :global

Problem:    Hang with combination of feedkeys(), Ex mode and :global.
            (Yegappan Lakshmanan)
Solution:   Add the pending_exmode_active flag.
This commit is contained in:
Bram Moolenaar 2020-02-18 21:33:00 +01:00
parent 1fa8d2c33d
commit 9e2bcb5d23
5 changed files with 20 additions and 0 deletions

View File

@ -6185,9 +6185,11 @@ do_exedit(
hold_gui_events = 0; hold_gui_events = 0;
#endif #endif
must_redraw = CLEAR; must_redraw = CLEAR;
pending_exmode_active = TRUE;
main_loop(FALSE, TRUE); main_loop(FALSE, TRUE);
pending_exmode_active = FALSE;
RedrawingDisabled = rd; RedrawingDisabled = rd;
no_wait_return = nwr; no_wait_return = nwr;
msg_scroll = ms; msg_scroll = ms;

View File

@ -3041,6 +3041,10 @@ vgetorpeek(int advance)
#ifdef FEAT_CMDWIN #ifdef FEAT_CMDWIN
tc = c; tc = c;
#endif #endif
// return from main_loop()
if (pending_exmode_active)
exmode_active = EXMODE_NORMAL;
break; break;
} }

View File

@ -1028,6 +1028,10 @@ EXTERN int motion_force INIT(= 0); // motion force for pending operator
* Ex mode (Q) state * Ex mode (Q) state
*/ */
EXTERN int exmode_active INIT(= 0); // zero, EXMODE_NORMAL or EXMODE_VIM 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 ex_no_reprint INIT(= FALSE); // no need to print after z or p
EXTERN int reg_recording INIT(= 0); // register for recording or zero EXTERN int reg_recording INIT(= 0); // register for recording or zero

View File

@ -111,4 +111,12 @@ func Test_open_command()
close! close!
endfunc 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: shiftwidth=2 sts=2 expandtab

View File

@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
274,
/**/ /**/
273, 273,
/**/ /**/