Skip to content

Commit 4340fc9

Browse files
committed
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.
1 parent 13b47c3 commit 4340fc9

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/channel.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,9 +2851,13 @@ channel_has_readahead(channel_T *channel, ch_part_T part)
28512851
if (ch_mode == MODE_JSON || ch_mode == MODE_JS)
28522852
{
28532853
jsonq_T *head = &channel->ch_part[part].ch_json_head;
2854-
jsonq_T *item = head->jq_next;
28552854

2856-
return item != NULL;
2855+
if (head->jq_next == NULL)
2856+
// Parse json from readahead, there might be a complete message to
2857+
// process.
2858+
channel_parse_json(channel, part);
2859+
2860+
return head->jq_next != NULL;
28572861
}
28582862
return channel_peek(channel, part) != NULL;
28592863
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ static char *(features[]) =
777777

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1605,
780782
/**/
781783
1604,
782784
/**/

0 commit comments

Comments
 (0)