comparison src/terminal.c @ 26598:b3ac5a4dc158 v8.2.3828

patch 8.2.3828: when opening a terminal from a timer first typed char is lost Commit: https://github.com/vim/vim/commit/8103527da7f12ff21c2566222748518ee093432c Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 16 18:02:07 2021 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Thu, 16 Dec 2021 19:15:04 +0100
parents 15764dc9a59d
children fc859aea8cec
comparison
equal deleted inserted replaced
26597:0a31a23836de 26598:b3ac5a4dc158
736 { 736 {
737 --curbuf->b_nwindows; 737 --curbuf->b_nwindows;
738 curbuf = old_curbuf; 738 curbuf = old_curbuf;
739 curwin->w_buffer = curbuf; 739 curwin->w_buffer = curbuf;
740 ++curbuf->b_nwindows; 740 ++curbuf->b_nwindows;
741 }
742 else if (vgetc_busy
743 #ifdef FEAT_TIMERS
744 || timer_busy
745 #endif
746 || input_busy)
747 {
748 char_u ignore[4];
749
750 // When waiting for input need to return and possibly end up in
751 // terminal_loop() instead.
752 ignore[0] = K_SPECIAL;
753 ignore[1] = KS_EXTRA;
754 ignore[2] = KE_IGNORE;
755 ignore[3] = NUL;
756 ins_typebuf(ignore, REMAP_NONE, 0, TRUE, FALSE);
757 typebuf_was_filled = TRUE;
741 } 758 }
742 } 759 }
743 else 760 else
744 { 761 {
745 term_close_buffer(curbuf, old_curbuf); 762 term_close_buffer(curbuf, old_curbuf);