Skip to content

Commit

Permalink
patch 8.1.0158: GUI: input() fails if CTRL-C was pressed before
Browse files Browse the repository at this point in the history
Problem:    GUI: input() fails if CTRL-C was pressed before. (Michael Naumann)
Solution:   call vpeekc() to drop the CTRL-C from the input stream.
  • Loading branch information
brammool committed Jul 7, 2018
1 parent e330ef4 commit 1ebff3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ex_docmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9157,6 +9157,11 @@ do_sleep(long msec)
parse_queued_messages();
#endif
}

// If CTRL-C was typed to interrupt the sleep, drop the CTRL-C from the
// input buffer, otherwise a following call to input() fails.
if (got_int)
(void)vpeekc();
}

static void
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
158,
/**/
157,
/**/
Expand Down

0 comments on commit 1ebff3d

Please sign in to comment.