Skip to content

Commit e49b4bb

Browse files
committed
patch 8.2.0370: the typebuf_was_filled flag is sometimes not reset
Problem: The typebuf_was_filled flag is sometimes not reset, which may cause a hang. Solution: Make sure typebuf_was_filled is reset when the typeahead buffer is empty.
1 parent 1671f44 commit e49b4bb

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/edit.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,10 @@ decodeModifyOtherKeys(int c)
16121612
// Match, consume the code.
16131613
typebuf.tb_off += idx + 1;
16141614
typebuf.tb_len -= idx + 1;
1615+
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
1616+
if (typebuf.tb_len == 0)
1617+
typebuf_was_filled = FALSE;
1618+
#endif
16151619

16161620
mod_mask = decode_modifiers(arg[!form]);
16171621
c = merge_modifyOtherKeys(arg[form]);

src/getchar.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ flush_buffers(flush_buffers_T flush_typeahead)
421421
// remove mapped characters at the start only
422422
typebuf.tb_off += typebuf.tb_maplen;
423423
typebuf.tb_len -= typebuf.tb_maplen;
424+
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
425+
if (typebuf.tb_len == 0)
426+
typebuf_was_filled = FALSE;
427+
#endif
424428
}
425429
else
426430
{
@@ -1283,6 +1287,9 @@ alloc_typebuf(void)
12831287
typebuf.tb_no_abbr_cnt = 0;
12841288
if (++typebuf.tb_change_cnt == 0)
12851289
typebuf.tb_change_cnt = 1;
1290+
#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
1291+
typebuf_was_filled = FALSE;
1292+
#endif
12861293
return OK;
12871294
}
12881295

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
370,
741743
/**/
742744
369,
743745
/**/

0 commit comments

Comments
 (0)