comparison src/channel.c @ 17212:fd983b381ec0 v8.1.1605

patch 8.1.1605: Vim may delay processing messages on a json channel commit https://github.com/vim/vim/commit/4340fc95d50518c6eb199107e5f1144f210c7ee5 Author: Bram Moolenaar <Bram@vim.org> 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.
author Bram Moolenaar <Bram@vim.org>
date Fri, 28 Jun 2019 22:15:05 +0200
parents cee12488e4bc
children d04de6c49f59
comparison
equal deleted inserted replaced
17211:7b6fc912182c 17212:fd983b381ec0
2849 ch_mode_T ch_mode = channel->ch_part[part].ch_mode; 2849 ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
2850 2850
2851 if (ch_mode == MODE_JSON || ch_mode == MODE_JS) 2851 if (ch_mode == MODE_JSON || ch_mode == MODE_JS)
2852 { 2852 {
2853 jsonq_T *head = &channel->ch_part[part].ch_json_head; 2853 jsonq_T *head = &channel->ch_part[part].ch_json_head;
2854 jsonq_T *item = head->jq_next; 2854
2855 2855 if (head->jq_next == NULL)
2856 return item != 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;
2857 } 2861 }
2858 return channel_peek(channel, part) != NULL; 2862 return channel_peek(channel, part) != NULL;
2859 } 2863 }
2860 2864
2861 /* 2865 /*