From 992eaac08218c037ffa8980f36a628f5b293355b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 16 Jan 2026 02:11:07 -0500 Subject: [PATCH] vim-patch:8.2.0370: the typebuf_was_filled flag is sometimes not reset (#37404) 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. https://github.com/vim/vim/commit/e49b4bb89505fad28cf89f0891aef3e2d397919e Co-authored-by: Bram Moolenaar --- src/nvim/getchar.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index e824d1fcc1..10bf78839d 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -458,6 +458,9 @@ void flush_buffers(flush_buffers_T flush_typeahead) typebuf.tb_off += typebuf.tb_maplen; typebuf.tb_len -= typebuf.tb_maplen; } + if (typebuf.tb_len == 0) { + typebuf_was_filled = false; + } } else { // remove typeahead if (flush_typeahead == FLUSH_INPUT) { @@ -1300,6 +1303,7 @@ static void alloc_typebuf(void) if (++typebuf.tb_change_cnt == 0) { typebuf.tb_change_cnt = 1; } + typebuf_was_filled = false; } /// Free the buffers of "typebuf".