# HG changeset patch # User Bram Moolenaar # Date 1561752905 -7200 # Node ID fd983b381ec0c08bdb46e305258dda8c05fb461e # Parent 7b6fc912182ccf6126e33c33cdbd0bfa181f24ed patch 8.1.1605: Vim may delay processing messages on a json channel commit https://github.com/vim/vim/commit/4340fc95d50518c6eb199107e5f1144f210c7ee5 Author: Bram Moolenaar Date: Fri Jun 28 22:06:49 2019 +0200 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 --- a/src/channel.c +++ b/src/channel.c @@ -2851,9 +2851,13 @@ channel_has_readahead(channel_T *channel 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; } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1605, +/**/ 1604, /**/ 1603,