mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
vim-patch:9.0.0234: cannot make difference between :normal end and argument char (#19879)
Problem: Cannot make difference between the end of :normal and a character
in its argument.
Solution: Add the "typebuf_was_empty" flag. (closes vim/vim#10950)
8d69637133
This commit is contained in:
@@ -2400,7 +2400,8 @@ static int vgetorpeek(bool advance)
|
|||||||
vgetc_busy++;
|
vgetc_busy++;
|
||||||
|
|
||||||
if (advance) {
|
if (advance) {
|
||||||
KeyStuffed = FALSE;
|
KeyStuffed = false;
|
||||||
|
typebuf_was_empty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_typebuf();
|
init_typebuf();
|
||||||
@@ -2626,6 +2627,11 @@ static int vgetorpeek(bool advance)
|
|||||||
}
|
}
|
||||||
tc = c;
|
tc = c;
|
||||||
|
|
||||||
|
// set a flag to indicate this wasn't a normal char
|
||||||
|
if (advance) {
|
||||||
|
typebuf_was_empty = true;
|
||||||
|
}
|
||||||
|
|
||||||
// return 0 in normal_check()
|
// return 0 in normal_check()
|
||||||
if (pending_exmode_active) {
|
if (pending_exmode_active) {
|
||||||
exmode_active = true;
|
exmode_active = true;
|
||||||
|
@@ -705,6 +705,10 @@ EXTERN int recoverymode INIT(= false); // Set to true for "-r" option
|
|||||||
// typeahead buffer
|
// typeahead buffer
|
||||||
EXTERN typebuf_T typebuf INIT(= { NULL, NULL, 0, 0, 0, 0, 0, 0, 0 });
|
EXTERN typebuf_T typebuf INIT(= { NULL, NULL, 0, 0, 0, 0, 0, 0, 0 });
|
||||||
|
|
||||||
|
/// Flag used to indicate that vgetorpeek() returned a char like Esc when the
|
||||||
|
/// :normal argument was exhausted.
|
||||||
|
EXTERN bool 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()
|
||||||
EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal()
|
EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal()
|
||||||
EXTERN int ignore_script INIT(= false); // ignore script input
|
EXTERN int ignore_script INIT(= false); // ignore script input
|
||||||
|
@@ -6943,10 +6943,10 @@ static void nv_esc(cmdarg_T *cap)
|
|||||||
got_int = false; // don't stop executing autocommands et al.
|
got_int = false; // don't stop executing autocommands et al.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} 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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user