]> granicus.if.org Git - vim/commitdiff
patch 7.4.1825 v7.4.1825
authorBram Moolenaar <Bram@vim.org>
Sun, 8 May 2016 19:47:01 +0000 (21:47 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 8 May 2016 19:47:01 +0000 (21:47 +0200)
Problem:    When job writes to buffer nothing is written. (Nicola)
Solution:   Do not discard a channel before writing is done.

src/channel.c
src/version.c

index e9a44e66c1c7c2c34ff7098faf69ccab1de37937..8433236227cf61d4a8e11eb9cfcae7df94d2040c 100644 (file)
@@ -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);
 }
 
 /*
index 6ee3c96d0feaa403810802b5f2a76eddef506758..a6f85c3e327fc73f1cf0d710725de1f7cc1e172d 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1825,
 /**/
     1824,
 /**/