mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.0.0234: cannot make difference between :normal end and argument char
Problem: Cannot make difference between the end of :normal and a character in its argument. Solution: Add the "typebuf_was_empty" flag. (closes #10950)
This commit is contained in:
@@ -3056,7 +3056,10 @@ vgetorpeek(int advance)
|
|||||||
++vgetc_busy;
|
++vgetc_busy;
|
||||||
|
|
||||||
if (advance)
|
if (advance)
|
||||||
|
{
|
||||||
KeyStuffed = FALSE;
|
KeyStuffed = FALSE;
|
||||||
|
typebuf_was_empty = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
init_typebuf();
|
init_typebuf();
|
||||||
start_stuff();
|
start_stuff();
|
||||||
@@ -3361,6 +3364,10 @@ vgetorpeek(int advance)
|
|||||||
#ifdef FEAT_CMDWIN
|
#ifdef FEAT_CMDWIN
|
||||||
tc = c;
|
tc = c;
|
||||||
#endif
|
#endif
|
||||||
|
// set a flag to indicate this wasn't a normal char
|
||||||
|
if (advance)
|
||||||
|
typebuf_was_empty = TRUE;
|
||||||
|
|
||||||
// return from main_loop()
|
// return from main_loop()
|
||||||
if (pending_exmode_active)
|
if (pending_exmode_active)
|
||||||
exmode_active = EXMODE_NORMAL;
|
exmode_active = EXMODE_NORMAL;
|
||||||
|
@@ -1206,6 +1206,10 @@ EXTERN typebuf_T typebuf // typeahead buffer
|
|||||||
= {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}
|
= {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
// Flag used to indicate that vgetorpeek() returned a char like Esc when the
|
||||||
|
// :normal argument was exhausted.
|
||||||
|
EXTERN int typebuf_was_empty INIT(= FALSE);
|
||||||
|
|
||||||
EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal()
|
EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal()
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
EXTERN int in_feedkeys INIT(= 0); // ex_normal_busy set in feedkeys()
|
EXTERN int in_feedkeys INIT(= 0); // ex_normal_busy set in feedkeys()
|
||||||
|
@@ -6808,11 +6808,11 @@ nv_esc(cmdarg_T *cap)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef FEAT_CMDWIN
|
#ifdef FEAT_CMDWIN
|
||||||
else if (cmdwin_type != 0 && ex_normal_busy)
|
else if (cmdwin_type != 0 && ex_normal_busy && typebuf_was_empty)
|
||||||
{
|
{
|
||||||
// When :normal runs out of characters while in the command line window
|
// When :normal runs out of characters while in the command line window
|
||||||
// vgetorpeek() will return ESC. Exit the cmdline window to break the
|
// vgetorpeek() will repeatedly return ESC. Exit the cmdline window to
|
||||||
// loop.
|
// break the loop.
|
||||||
cmdwin_result = K_IGNORE;
|
cmdwin_result = K_IGNORE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -731,6 +731,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 */
|
||||||
|
/**/
|
||||||
|
234,
|
||||||
/**/
|
/**/
|
||||||
233,
|
233,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user