Mercurial > vim
comparison src/channel.c @ 7780:e09af43f98f7 v7.4.1187
commit https://github.com/vim/vim/commit/85be35f33ea848b50e84d57321a45ebfedfad669
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 27 21:08:18 2016 +0100
patch 7.4.1187
Problem: MS-Windows channel code only supports one channel. Doesn't build
without netbeans support.
Solution: Get the channel index from the socket in the message. Closes https://github.com/vim/vim/issues/600.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 27 Jan 2016 21:15:05 +0100 |
parents | 656db98806b3 |
children | 192ae655ac91 |
comparison
equal
deleted
inserted
replaced
7779:cb1957f23ea4 | 7780:e09af43f98f7 |
---|---|
205 # else | 205 # else |
206 # ifdef FEAT_GUI_W32 | 206 # ifdef FEAT_GUI_W32 |
207 /* | 207 /* |
208 * Tell Windows we are interested in receiving message when there | 208 * Tell Windows we are interested in receiving message when there |
209 * is input on the editor connection socket. | 209 * is input on the editor connection socket. |
210 * TODO: change WM_NETBEANS to something related to the channel index. | |
211 */ | 210 */ |
212 if (channel->ch_inputHandler == -1) | 211 if (channel->ch_inputHandler == -1) |
213 channel->ch_inputHandler = | 212 channel->ch_inputHandler = |
214 WSAAsyncSelect(channel->ch_fd, s_hwnd, WM_NETBEANS, FD_READ); | 213 WSAAsyncSelect(channel->ch_fd, s_hwnd, WM_NETBEANS, FD_READ); |
215 # endif | 214 # endif |
646 if (CH_HAS_GUI && gtk_main_level() > 0) | 645 if (CH_HAS_GUI && gtk_main_level() > 0) |
647 gtk_main_quit(); | 646 gtk_main_quit(); |
648 #endif | 647 #endif |
649 } | 648 } |
650 | 649 |
650 # if defined(FEAT_GUI_W32) || defined(PROTO) | |
651 /* | |
652 * Lookup the channel index from the socket. | |
653 * Returns -1 when the socket isn't found. | |
654 */ | |
655 int | |
656 channel_socket2idx(sock_T fd) | |
657 { | |
658 int i; | |
659 | |
660 if (fd >= 0) | |
661 for (i = 0; i < channel_count; ++i) | |
662 if (channels[i].ch_fd == fd) | |
663 return i; | |
664 return -1; | |
665 } | |
666 # endif | |
667 | |
651 /* | 668 /* |
652 * Write "buf" (NUL terminated string) to channel "idx". | 669 * Write "buf" (NUL terminated string) to channel "idx". |
653 * When "fun" is not NULL an error message might be given. | 670 * When "fun" is not NULL an error message might be given. |
654 */ | 671 */ |
655 void | 672 void |