diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-28 22:32:58 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-28 22:32:58 +0100 |
commit | 12dfc9eef14fe74c46145aa9e6cba9666f1bcd40 (patch) | |
tree | 3a3c98030644028f710d33d7c2b2558ac0f2db13 /src/gui_gtk_x11.c | |
parent | f58d81a18752cb9bf899b3f7328fc489cf6558e8 (diff) |
patch 8.1.0840: getchar(0) never returns a character in the terminalv8.1.0840
Problem: getchar(0) never returns a character in the terminal.
Solution: Call wait_func() at least once.
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r-- | src/gui_gtk_x11.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 6882733696..e1de83a68b 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -6317,10 +6317,11 @@ gui_mch_wait_for_chars(long wtime) timed_out = FALSE; - /* this timeout makes sure that we will return if no characters arrived in - * time */ - if (wtime > 0) - timer = timeout_add(wtime, input_timer_cb, &timed_out); + // This timeout makes sure that we will return if no characters arrived in + // time. If "wtime" is zero just use one. + if (wtime >= 0) + timer = timeout_add(wtime <= 0 ? 1L : wtime, + input_timer_cb, &timed_out); else timer = 0; |