diff options
author | Ron Yorston <rmy@pobox.com> | 2019-02-01 12:47:55 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-02-01 12:47:55 +0000 |
commit | 0e26e2ff3b87f8db635d3c7dca23f441a3961fd2 (patch) | |
tree | 5ce38f928d3d64a12ae6f3b8f8b0b4f44dcad611 | |
parent | 0aad680ce3c01a23fbcef8f67ed160e09936ab17 (diff) | |
download | busybox-w32-0e26e2ff3b87f8db635d3c7dca23f441a3961fd2.tar.gz busybox-w32-0e26e2ff3b87f8db635d3c7dca23f441a3961fd2.tar.bz2 busybox-w32-0e26e2ff3b87f8db635d3c7dca23f441a3961fd2.zip |
vi: simplify code to display pasted text
-rw-r--r-- | editors/vi.c | 12 |
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); |