patch 8.1.1605: Vim may delay processing messages on a json channel
Problem: Vim may delay processing messages on a json channel. (Pontus
Leitzler)
Solution: Try parsing json when checking if there is readahead.
diff --git a/src/channel.c b/src/channel.c
index 7671e19..eb5af0a 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -2851,9 +2851,13 @@
if (ch_mode == MODE_JSON || ch_mode == MODE_JS)
{
jsonq_T *head = &channel->ch_part[part].ch_json_head;
- jsonq_T *item = head->jq_next;
- return item != NULL;
+ if (head->jq_next == NULL)
+ // Parse json from readahead, there might be a complete message to
+ // process.
+ channel_parse_json(channel, part);
+
+ return head->jq_next != NULL;
}
return channel_peek(channel, part) != NULL;
}