1
0
forked from aniani/vim

patch 8.2.4722: ending recording with mapping records too much

Problem:    When a recording is ended with a mapped key that key is also
            recorded.
Solution:   Remember the previous last_recorded_len. (closes #10122)
This commit is contained in:
zeertzjq
2022-04-09 17:58:49 +01:00
committed by Bram Moolenaar
parent 36951ed1da
commit 81b46a6ccd
3 changed files with 32 additions and 1 deletions

View File

@@ -1705,10 +1705,16 @@ vgetc(void)
}
else
{
// number of characters recorded from the last vgetc() call
static int last_vgetc_recorded_len = 0;
mod_mask = 0;
vgetc_mod_mask = 0;
vgetc_char = 0;
last_recorded_len = 0;
// last_recorded_len can be larger than last_vgetc_recorded_len
// if peeking records more
last_recorded_len -= last_vgetc_recorded_len;
for (;;) // this is done twice if there are modifiers
{
@@ -1910,6 +1916,8 @@ vgetc(void)
break;
}
last_vgetc_recorded_len = last_recorded_len;
}
#ifdef FEAT_EVAL