File tree Expand file tree Collapse file tree 6 files changed +25
-12
lines changed
Expand file tree Collapse file tree 6 files changed +25
-12
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,6 @@ channel_gui_register(int idx)
207207 /*
208208 * Tell Windows we are interested in receiving message when there
209209 * is input on the editor connection socket.
210- * TODO: change WM_NETBEANS to something related to the channel index.
211210 */
212211 if (channel -> ch_inputHandler == -1 )
213212 channel -> ch_inputHandler =
@@ -648,6 +647,24 @@ channel_read(int idx)
648647#endif
649648}
650649
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+
651668/*
652669 * Write "buf" (NUL terminated string) to channel "idx".
653670 * When "fun" is not NULL an error message might be given.
Original file line number Diff line number Diff line change @@ -1782,8 +1782,10 @@ process_message(void)
17821782#ifdef FEAT_CHANNEL
17831783 if (msg .message == WM_NETBEANS )
17841784 {
1785- /* TODO: channel_read(idx) */
1786- netbeans_read ();
1785+ int channel_idx = channel_socket2idx ((sock_T )msg .wParam );
1786+
1787+ if (channel_idx >= 0 )
1788+ channel_read (channel_idx );
17871789 return ;
17881790 }
17891791#endif
Original file line number Diff line number Diff line change @@ -427,14 +427,6 @@ netbeans_parse_messages(void)
427427 }
428428}
429429
430- /* TODO: remove */
431- void
432- netbeans_read ()
433- {
434- if (nb_channel_idx >= 0 )
435- channel_read (nb_channel_idx );
436- }
437-
438430/*
439431 * Handle one NUL terminated command.
440432 *
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ char_u *channel_get(int idx);
99int channel_collapse (int idx );
1010void channel_clear (int idx );
1111void channel_read (int idx );
12+ int channel_socket2idx (sock_T fd );
1213void channel_send (int idx , char_u * buf , char * fun );
1314int channel_poll_setup (int nfd_in , void * fds_in );
1415int channel_poll_check (int ret_in , void * fds_in );
Original file line number Diff line number Diff line change 11/* netbeans.c */
22void netbeans_parse_messages (void );
3- void netbeans_read (void );
43int isNetbeansBuffer (buf_T * bufp );
54int isNetbeansModified (buf_T * bufp );
65void netbeans_end (void );
Original file line number Diff line number Diff line change @@ -746,6 +746,8 @@ static char *(features[]) =
746746
747747static int included_patches [] =
748748{ /* Add new patch number below this line */
749+ /**/
750+ 1187 ,
749751/**/
750752 1186 ,
751753/**/
You can’t perform that action at this time.
0 commit comments