diff src/channel.c @ 10418:56cb9538386c v8.0.0103

commit https://github.com/vim/vim/commit/8a8199e4a1814b10630a770165502abb1121cd1b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 26 15:13:33 2016 +0100 patch 8.0.0103 Problem: May not process channel readahead. (skywind) Solution: If there is readahead don't block on input.
author Christian Brabandt <cb@256bit.org>
date Sat, 26 Nov 2016 15:15:03 +0100
parents 42911b233245
children e664ee056a84
line wrap: on
line diff
--- 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