diff options
| author | Bram Moolenaar <Bram@vim.org> | 2016-05-08 21:47:01 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2016-05-08 21:47:01 +0200 |
| commit | 5d96e3ae534ade8ed09a5de9ff8fd7519537ec28 (patch) | |
| tree | 18290c17b9be77a51fe35d9de8a14e8017bd0637 /src/channel.c | |
| parent | 36e0f7da9bc4a6ee8a7b17df503542a339e034c8 (diff) | |
| download | vim-git-5d96e3ae534ade8ed09a5de9ff8fd7519537ec28.tar.gz | |
patch 7.4.1825v7.4.1825
Problem: When job writes to buffer nothing is written. (Nicola)
Solution: Do not discard a channel before writing is done.
Diffstat (limited to 'src/channel.c')
| -rw-r--r-- | src/channel.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c index e9a44e66c..843323622 100644 --- 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); } /* |
