]> granicus.if.org Git - vim/commitdiff
patch 8.1.1605: Vim may delay processing messages on a json channel v8.1.1605
authorBram Moolenaar <Bram@vim.org>
Fri, 28 Jun 2019 20:06:49 +0000 (22:06 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 28 Jun 2019 20:06:49 +0000 (22:06 +0200)
Problem:    Vim may delay processing messages on a json channel. (Pontus
            Leitzler)
Solution:   Try parsing json when checking if there is readahead.

src/channel.c
src/version.c

index 7671e19a6277a7fda636e4113bb49b66c2a9e4ec..eb5af0aa463f808b5c6ccf65c442afa08ae1c211 100644 (file)
@@ -2851,9 +2851,13 @@ channel_has_readahead(channel_T *channel, ch_part_T part)
     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;
 }
index 9c29b46d8ec5a0c799f2fff45fe79823a2795dc1..53c3c66fe129e2226a2831ffbe79ec672b715f48 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1605,
 /**/
     1604,
 /**/