summaryrefslogtreecommitdiff
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-11-26 15:13:33 +0100
committerBram Moolenaar <Bram@vim.org>2016-11-26 15:13:33 +0100
commit8a8199e4a1814b10630a770165502abb1121cd1b (patch)
treec6fe9958116a7cea4ca4bcbdb18c2b3f33bf4530 /src/channel.c
parent7554da4033498c4da0af3cde542c3e87e9097b73 (diff)
downloadvim-git-8a8199e4a1814b10630a770165502abb1121cd1b.tar.gz
patch 8.0.0103v8.0.0103
Problem: May not process channel readahead. (skywind) Solution: If there is readahead don't block on input.
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/channel.c b/src/channel.c
index 19520e200..6c5a4ff1d 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -3900,6 +3900,31 @@ channel_parse_messages(void)
}
/*
+ * Return TRUE if any channel has readahead. That means we should not block on
+ * waiting for input.
+ */
+ int
+channel_any_readahead(void)
+{
+ channel_T *channel = first_channel;
+ ch_part_T part = PART_SOCK;
+
+ while (channel != NULL)
+ {
+ if (channel_has_readahead(channel, part))
+ return TRUE;
+ if (part < PART_ERR)
+ ++part;
+ else
+ {
+ channel = channel->ch_next;
+ part = PART_SOCK;
+ }
+ }
+ return FALSE;
+}
+
+/*
* Mark references to lists used in channels.
*/
int