diff src/gui_gtk_x11.c @ 15665:31367ce5aac7 v8.1.0840

patch 8.1.0840: getchar(0) never returns a character in the terminal commit https://github.com/vim/vim/commit/12dfc9eef14fe74c46145aa9e6cba9666f1bcd40 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 28 22:32:58 2019 +0100 patch 8.1.0840: getchar(0) never returns a character in the terminal Problem: getchar(0) never returns a character in the terminal. Solution: Call wait_func() at least once.
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Jan 2019 22:45:05 +0100
parents d89c5b339c2a
children e5441bee8063
line wrap: on
line diff
--- 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;