changeset 9081:b2b915c1d311 v7.4.1825

commit https://github.com/vim/vim/commit/5d96e3ae534ade8ed09a5de9ff8fd7519537ec28 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 8 21:47:01 2016 +0200 patch 7.4.1825 Problem: When job writes to buffer nothing is written. (Nicola) Solution: Do not discard a channel before writing is done.
author Christian Brabandt <cb@256bit.org>
date Sun, 08 May 2016 22:00:06 +0200
parents af3def158d85
children ed95e35d74bd
files src/channel.c src/version.c
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -352,6 +352,10 @@ channel_still_useful(channel_T *channel)
     if (channel->ch_close_cb != NULL)
 	return TRUE;
 
+    /* If reading from or a buffer it's still useful. */
+    if (channel->ch_part[PART_IN].ch_buffer != NULL)
+	return TRUE;
+
     /* If there is no callback then nobody can get readahead.  If the fd is
      * closed and there is no readahead then the callback won't be called. */
     has_sock_msg = channel->ch_part[PART_SOCK].ch_fd != INVALID_FD
@@ -365,8 +369,10 @@ channel_still_useful(channel_T *channel)
 		  || channel->ch_part[PART_ERR].ch_json_head.jq_next != NULL;
     return (channel->ch_callback != NULL && (has_sock_msg
 		|| has_out_msg || has_err_msg))
-	    || (channel->ch_part[PART_OUT].ch_callback != NULL && has_out_msg)
-	    || (channel->ch_part[PART_ERR].ch_callback != NULL && has_err_msg);
+	    || ((channel->ch_part[PART_OUT].ch_callback != NULL
+		      || channel->ch_part[PART_OUT].ch_buffer) && has_out_msg)
+	    || ((channel->ch_part[PART_ERR].ch_callback != NULL
+		     || channel->ch_part[PART_ERR].ch_buffer) && has_err_msg);
 }
 
 /*
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1825,
+/**/
     1824,
 /**/
     1823,