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.

e49b4bb895

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2026-01-16 02:11:07 -05:00
committed by GitHub
parent 43339dee40
commit 992eaac082

View File

@@ -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".