diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-16 18:02:07 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-16 18:02:07 +0000 |
commit | 8103527da7f12ff21c2566222748518ee093432c (patch) | |
tree | 5840fd003b0c0eb5852dfa683ac058efa224dddc /src/edit.c | |
parent | f79cbf6512863c167bc794035df067e3a3e474f3 (diff) | |
download | vim-git-8103527da7f12ff21c2566222748518ee093432c.tar.gz |
patch 8.2.3828: when opening a terminal from a timer first typed char is lostv8.2.3828
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.
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/edit.c b/src/edit.c index 40d5c4e58..9ff1c184e 100644 --- a/src/edit.c +++ b/src/edit.c @@ -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; |