Skip to content

Commit 1ebff3d

Browse files
committed
patch 8.1.0158: GUI: input() fails if CTRL-C was pressed before
Problem: GUI: input() fails if CTRL-C was pressed before. (Michael Naumann) Solution: call vpeekc() to drop the CTRL-C from the input stream.
1 parent e330ef4 commit 1ebff3d

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/ex_docmd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9157,6 +9157,11 @@ do_sleep(long msec)
91579157
parse_queued_messages();
91589158
#endif
91599159
}
9160+
9161+
// If CTRL-C was typed to interrupt the sleep, drop the CTRL-C from the
9162+
// input buffer, otherwise a following call to input() fails.
9163+
if (got_int)
9164+
(void)vpeekc();
91609165
}
91619166

91629167
static void

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,8 @@ static char *(features[]) =
789789

790790
static int included_patches[] =
791791
{ /* Add new patch number below this line */
792+
/**/
793+
158,
792794
/**/
793795
157,
794796
/**/

0 commit comments

Comments
 (0)