patch 8.2.4705: jump list marker disappears
Problem: Jump list marker disappears.
Solution: Reset reg_executing later. (closes #10111, closes #10100)
diff --git a/src/getchar.c b/src/getchar.c
index b81f64a..29ad56e 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1421,7 +1421,7 @@
static int old_mouse_col; // mouse_col related to old_char
static int old_KeyStuffed; // whether old_char was stuffed
-static int can_get_old_char()
+static int can_get_old_char(void)
{
// If the old character was not stuffed and characters have been added to
// the stuff buffer, need to first get the stuffed characters instead.
@@ -2950,7 +2950,7 @@
/*
* unget one character (can only be done once!)
- * If the character was stuffed, vgetc() will get it next time it was called.
+ * If the character was stuffed, vgetc() will get it next time it is called.
* Otherwise vgetc() will only get it when the stuff buffer is empty.
*/
void
@@ -2964,6 +2964,27 @@
}
/*
+ * When peeking and not getting a character, reg_executing cannot be cleared
+ * yet, so set a flag to clear it later.
+ */
+ static void
+check_end_reg_executing(int advance)
+{
+ if (reg_executing != 0 && (typebuf.tb_maplen == 0
+ || pending_end_reg_executing))
+ {
+ if (advance)
+ {
+ reg_executing = 0;
+ pending_end_reg_executing = FALSE;
+ }
+ else
+ pending_end_reg_executing = TRUE;
+ }
+
+}
+
+/*
* Get a byte:
* 1. from the stuffbuffer
* This is used for abbreviated commands like "D" -> "d$".
@@ -3026,8 +3047,7 @@
init_typebuf();
start_stuff();
- if (advance && typebuf.tb_maplen == 0)
- reg_executing = 0;
+ check_end_reg_executing(advance);
do
{
/*
@@ -3068,6 +3088,7 @@
#ifdef FEAT_CMDL_INFO
int showcmd_idx;
#endif
+ check_end_reg_executing(advance);
/*
* ui_breakcheck() is slow, don't use it too often when
* inside a mapping. But call it each time for typed