diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-29 21:11:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-29 21:11:25 +0100 |
commit | f12d983deab06b0408781d7a6c2f8970d765b723 (patch) | |
tree | 50d51bd7d02ffaebeba71a2faecb0380a4a04f84 /src/os_win32.c | |
parent | 83162468b3c8722fffea033d3de144cd4191472a (diff) | |
download | vim-git-f12d983deab06b0408781d7a6c2f8970d765b723.tar.gz |
patch 7.4.1195v7.4.1195
Problem: The channel feature does not work in the MS-Windows console.
Solution: Add win32 console support. (Yasuhiro Matsumoto)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r-- | src/os_win32.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/os_win32.c b/src/os_win32.c index be7bd95b5..5a84824d3 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -1443,6 +1443,11 @@ WaitForChar(long msec) INPUT_RECORD ir; DWORD cRecords; WCHAR ch, ch2; +#ifdef FEAT_CHANNEL + int ret; + fd_set rfds; + int maxfd; +#endif if (msec > 0) /* Wait until the specified time has elapsed. */ @@ -1459,9 +1464,22 @@ WaitForChar(long msec) #ifdef FEAT_MZSCHEME mzvim_check_threads(); #endif + #ifdef FEAT_CLIENTSERVER serverProcessPendingMessages(); #endif + +#ifdef FEAT_CHANNEL + FD_ZERO(&rfds); + maxfd = channel_select_setup(-1, &rfds); + if (maxfd >= 0) + { + ret = select(maxfd + 1, &rfds, NULL, NULL, NULL); + if (ret > 0 && channel_select_check(ret, &rfds) > 0) + return TRUE; + } +#endif + if (0 #ifdef FEAT_MOUSE || g_nMouseClick != -1 @@ -1562,6 +1580,7 @@ WaitForChar(long msec) if (input_available()) return TRUE; #endif + return FALSE; } |