aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/vi.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 7b7f95cb1..3c758cca0 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2831,14 +2831,10 @@ static int mysleep(int hund) // sleep for 'hund' 1/100 seconds or stdin ready
2831 /* Allow one event in the queue. Otherwise pasted test isn't 2831 /* Allow one event in the queue. Otherwise pasted test isn't
2832 * displayed because there's still a key release event waiting 2832 * displayed because there's still a key release event waiting
2833 * after the last character is processed. */ 2833 * after the last character is processed. */
2834 INPUT_RECORD record[2]; 2834 DWORD nevent_out;
2835 DWORD nevent_out, mode; 2835
2836 2836 ret = GetNumberOfConsoleInputEvents(h, &nevent_out);
2837 GetConsoleMode(h, &mode); 2837 return ret != 0 ? (nevent_out > 1) : 0;
2838 SetConsoleMode(h, 0);
2839 ret = PeekConsoleInput(h, record, 2, &nevent_out);
2840 GetConsoleMode(h, &mode);
2841 return ret == 0 ? (nevent_out > 1) : 0;
2842 } 2838 }
2843 fflush_all(); 2839 fflush_all();
2844 ret = WaitForSingleObject(h, hund*10); 2840 ret = WaitForSingleObject(h, hund*10);