Skip to content

Commit b31c3c3

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents ba94bdc + 85be35f commit b31c3c3

File tree

7 files changed

+36
-21
lines changed

7 files changed

+36
-21
lines changed

src/channel.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ channel_gui_register(int idx)
226226
/*
227227
* Tell Windows we are interested in receiving message when there
228228
* is input on the editor connection socket.
229-
* TODO: change WM_NETBEANS to something related to the channel index.
230229
*/
231230
if (channel->ch_inputHandler == -1)
232231
channel->ch_inputHandler =
@@ -697,6 +696,24 @@ channel_read(int idx)
697696
#endif
698697
}
699698

699+
# if defined(FEAT_GUI_W32) || defined(PROTO)
700+
/*
701+
* Lookup the channel index from the socket.
702+
* Returns -1 when the socket isn't found.
703+
*/
704+
int
705+
channel_socket2idx(sock_T fd)
706+
{
707+
int i;
708+
709+
if (fd >= 0)
710+
for (i = 0; i < channel_count; ++i)
711+
if (channels[i].ch_fd == fd)
712+
return i;
713+
return -1;
714+
}
715+
# endif
716+
700717
/*
701718
* Write "buf" (NUL terminated string) to channel "idx".
702719
* When "fun" is not NULL an error message might be given.

src/gui_w48.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

src/netbeans.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff 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
*

src/os_unix.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,10 +2824,10 @@ mch_copy_sec(from_file, to_file)
28242824
ret = setxattr((char*)to_file, name, buffer, (size_t)size, 0);
28252825
if (ret < 0)
28262826
{
2827-
MSG_PUTS(_("Could not set security context "));
2828-
MSG_PUTS(name);
2829-
MSG_PUTS(_(" for "));
2830-
msg_outtrans(to_file);
2827+
vim_snprintf((char *)IObuff, IOSIZE,
2828+
_("Could not set security context %s for %s"),
2829+
name, to_file);
2830+
msg_outtrans(IObuff);
28312831
msg_putchar('\n');
28322832
}
28332833
}
@@ -2844,11 +2844,11 @@ mch_copy_sec(from_file, to_file)
28442844
case ERANGE:
28452845
default:
28462846
/* no enough size OR unexpected error */
2847-
MSG_PUTS(_("Could not get security context "));
2848-
MSG_PUTS(name);
2849-
MSG_PUTS(_(" for "));
2850-
msg_outtrans(from_file);
2851-
MSG_PUTS(_(". Removing it!\n"));
2847+
vim_snprintf((char *)IObuff, IOSIZE,
2848+
_("Could not get security context %s for %s. Removing it!"),
2849+
name, from_file);
2850+
msg_puts(IObuff);
2851+
msg_putchar('\n');
28522852
/* FALLTHROUGH to remove the attribute */
28532853

28542854
case ENODATA:

src/proto/channel.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ char_u *channel_get(int idx);
99
int channel_collapse(int idx);
1010
void channel_clear(int idx);
1111
void channel_read(int idx);
12+
int channel_socket2idx(sock_T fd);
1213
void channel_send(int idx, char_u *buf, char *fun);
1314
int channel_poll_setup(int nfd_in, void *fds_in);
1415
int channel_poll_check(int ret_in, void *fds_in);

src/proto/netbeans.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* netbeans.c */
22
void netbeans_parse_messages(void);
3-
void netbeans_read(void);
43
int isNetbeansBuffer(buf_T *bufp);
54
int isNetbeansModified(buf_T *bufp);
65
void netbeans_end(void);

src/version.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,10 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1187,
766+
/**/
767+
1186,
764768
/**/
765769
1185,
766770
/**/

0 commit comments

Comments
 (0)