comparison src/channel.c @ 8204:08d251a1c178 v7.4.1395

commit https://github.com/vim/vim/commit/eed284a16977ab81fa6da8c9562990ba498acd8c Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 22 23:13:33 2016 +0100 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.
author Christian Brabandt <cb@256bit.org>
date Mon, 22 Feb 2016 23:15:04 +0100
parents ee84450e604e
children b717dae2f26d
comparison
equal deleted inserted replaced
8203:54a1717883ef 8204:08d251a1c178
1552 } 1552 }
1553 #endif 1553 #endif
1554 1554
1555 1555
1556 /* Sent when the channel is found closed when reading. */ 1556 /* 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"
1558 1559
1559 /* Buffer size for reading incoming messages. */ 1560 /* Buffer size for reading incoming messages. */
1560 #define MAXMSGSIZE 4096 1561 #define MAXMSGSIZE 4096
1561 1562
1562 /* 1563 /*
1656 static char_u *buf = NULL; 1657 static char_u *buf = NULL;
1657 int len = 0; 1658 int len = 0;
1658 int readlen = 0; 1659 int readlen = 0;
1659 sock_T fd; 1660 sock_T fd;
1660 int use_socket = FALSE; 1661 int use_socket = FALSE;
1662 char *msg;
1661 1663
1662 fd = channel->ch_part[part].ch_fd; 1664 fd = channel->ch_part[part].ch_fd;
1663 if (fd == INVALID_FD) 1665 if (fd == INVALID_FD)
1664 { 1666 {
1665 ch_error(channel, "channel_read() called while socket is closed"); 1667 ch_error(channel, "channel_read() called while socket is closed");
1719 * -> ui_breakcheck 1721 * -> ui_breakcheck
1720 * -> gui event loop or select loop 1722 * -> gui event loop or select loop
1721 * -> channel_read() 1723 * -> channel_read()
1722 */ 1724 */
1723 ch_errors(channel, "%s(): Cannot read", func); 1725 ch_errors(channel, "%s(): Cannot read", func);
1724 channel_save(channel, part, 1726 msg = channel->ch_part[part].ch_mode == MODE_RAW
1725 (char_u *)DETACH_MSG, (int)STRLEN(DETACH_MSG)); 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));
1726 1730
1727 /* TODO: When reading from stdout is not possible, should we try to 1731 /* TODO: When reading from stdout is not possible, should we try to
1728 * keep stdin and stderr open? Probably not, assume the other side 1732 * keep stdin and stderr open? Probably not, assume the other side
1729 * has died. */ 1733 * has died. */
1730 channel_close(channel); 1734 channel_close(channel);