Skip to content

Commit eed284a

Browse files
committed
patch 7.4.1395
Problem: Using DETACH in quotes is not compatible with the Netbeans interface. (Xavier de Gaye) Solution: Remove the quotes, only use them for JSON and JS mode.
1 parent 0b96247 commit eed284a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/channel.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,8 @@ channel_free_all(void)
15541554

15551555

15561556
/* Sent when the channel is found closed when reading. */
1557-
#define DETACH_MSG "\"DETACH\"\n"
1557+
#define DETACH_MSG_RAW "DETACH\n"
1558+
#define DETACH_MSG_JSON "\"DETACH\"\n"
15581559

15591560
/* Buffer size for reading incoming messages. */
15601561
#define MAXMSGSIZE 4096
@@ -1658,6 +1659,7 @@ channel_read(channel_T *channel, int part, char *func)
16581659
int readlen = 0;
16591660
sock_T fd;
16601661
int use_socket = FALSE;
1662+
char *msg;
16611663

16621664
fd = channel->ch_part[part].ch_fd;
16631665
if (fd == INVALID_FD)
@@ -1721,8 +1723,10 @@ channel_read(channel_T *channel, int part, char *func)
17211723
* -> channel_read()
17221724
*/
17231725
ch_errors(channel, "%s(): Cannot read", func);
1724-
channel_save(channel, part,
1725-
(char_u *)DETACH_MSG, (int)STRLEN(DETACH_MSG));
1726+
msg = channel->ch_part[part].ch_mode == MODE_RAW
1727+
|| channel->ch_part[part].ch_mode == MODE_NL
1728+
? DETACH_MSG_RAW : DETACH_MSG_JSON;
1729+
channel_save(channel, part, (char_u *)msg, (int)STRLEN(msg));
17261730

17271731
/* TODO: When reading from stdout is not possible, should we try to
17281732
* keep stdin and stderr open? Probably not, assume the other side

src/netbeans.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ nb_parse_cmd(char_u *cmd)
461461
/* NOTREACHED */
462462
}
463463

464-
if (STRCMP(cmd, "\"DETACH\"") == 0)
464+
if (STRCMP(cmd, "DETACH") == 0)
465465
{
466466
buf_T *buf;
467467

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1395,
751753
/**/
752754
1394,
753755
/**/

0 commit comments

Comments
 (0)