0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.2.3828: when opening a terminal from a timer first typed char is lost

Problem:    when opening a terminal from a timer the first typed character
            is lost. (Virginia Senioria)
Solution:   When opening a terminal while waiting for a character put K_IGNORE
            in the input buffer.
This commit is contained in:
Bram Moolenaar
2021-12-16 18:02:07 +00:00
parent f79cbf6512
commit 8103527da7
4 changed files with 52 additions and 2 deletions

View File

@@ -598,9 +598,14 @@ edit(
{
c = safe_vgetc();
if (stop_insert_mode)
if (stop_insert_mode
#ifdef FEAT_TERMINAL
|| (c == K_IGNORE && term_use_loop())
#endif
)
{
// Insert mode ended, possibly from a callback.
// Insert mode ended, possibly from a callback, or a timer
// must have opened a terminal window.
if (c != K_IGNORE && c != K_NOP)
vungetc(c);
count = 0;