Skip to content

Commit 9498828

Browse files
committed
Fix #222
1 parent 18694f1 commit 9498828

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

src/channel.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ typedef struct {
9494
#ifdef FEAT_GUI_W32
9595
int ch_inputHandler; /* simply ret.value of WSAAsyncSelect() */
9696
#endif
97+
#ifdef FEAT_GUI_MACVIM
98+
int ch_inputHandler;
99+
#endif
97100

98101
void (*ch_close_cb)(void); /* callback invoked when channel is closed */
99102
} channel_T;
@@ -174,7 +177,7 @@ messageFromNetbeans(gpointer clientData,
174177
}
175178
#endif
176179

177-
#if defined(FEAT_GUI_MACVIM)
180+
#ifdef FEAT_GUI_MACVIM
178181
static int
179182
sock_select(int s)
180183
{
@@ -234,7 +237,12 @@ channel_gui_register(int idx)
234237
* Tell Core Foundation we are interested in being called when there
235238
* is input on the editor connection socket
236239
*/
237-
gui_macvim_set_netbeans_socket(channel->ch_fd);
240+
if (channel->ch_inputHandler == -1) {
241+
channel->ch_inputHandler = 0;
242+
# ifdef FEAT_NETBEANS_INTG
243+
gui_macvim_set_netbeans_socket(channel->ch_fd);
244+
# endif
245+
}
238246
# endif
239247
# endif
240248
# endif
@@ -282,7 +290,13 @@ channel_gui_unregister(int idx)
282290
}
283291
# else
284292
# ifdef FEAT_GUI_MACVIM
285-
gui_macvim_set_netbeans_socket(-1);
293+
if (channel->ch_inputHandler == 0)
294+
{
295+
# ifdef FEAT_NETBEANS_INTG
296+
gui_macvim_set_netbeans_socket(-1);
297+
# endif
298+
channel->ch_inputHandler = -1;
299+
}
286300
# endif
287301
# endif
288302
# endif

src/netbeans.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ static void nb_free __ARGS((void));
6767
static int nb_channel_idx = -1;
6868

6969
static int r_cmdno; /* current command number for reply */
70-
#ifdef FEAT_GUI_MACVIM
71-
static int sock_select(int s);
72-
#endif
73-
7470
static int dosetvisible = FALSE;
7571

7672
/*
@@ -132,22 +128,6 @@ netbeans_close(void)
132128
#endif
133129
}
134130

135-
#if defined(FEAT_GUI_MACVIM)
136-
static int
137-
sock_select(int s)
138-
{
139-
fd_set readset;
140-
struct timeval timeout;
141-
142-
FD_ZERO(&readset);
143-
FD_SET(s, &readset);
144-
timeout.tv_sec = 0;
145-
timeout.tv_usec = 0;
146-
147-
return select(s + 1, &readset, NULL, NULL, &timeout);
148-
}
149-
#endif /* FEAT_GUI_MACVIM */
150-
151131
#define NB_DEF_HOST "localhost"
152132
#define NB_DEF_ADDR "3219"
153133
#define NB_DEF_PASS "changeme"

0 commit comments

Comments
 (0)