• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョン49e38e5472e64ee713311d5d4e4fba0c150fb5ea (tree)
日時2020-03-29 02:15:04
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.0466: not parsing messages recursively breaks the govim plugin

Commit: https://github.com/vim/vim/commit/09c569038c42dcbdaa5c9b35fc9d1afbe5072cb4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 28 18:06:31 2020 +0100

patch 8.2.0466: not parsing messages recursively breaks the govim plugin
Problem: Not parsing messages recursively breaks the govim plugin.
Solution: When called recursively do handle messages but do not close
channels.

変更サマリ

差分

diff -r b08a044fe7e7 -r 49e38e5472e6 src/channel.c
--- a/src/channel.c Sat Mar 28 15:00:11 2020 +0100
+++ b/src/channel.c Sat Mar 28 18:15:04 2020 +0100
@@ -4428,16 +4428,14 @@
44284428 int ret = FALSE;
44294429 int r;
44304430 ch_part_T part = PART_SOCK;
4431- static int recursive = FALSE;
4431+ static int recursive = 0;
44324432 #ifdef ELAPSED_FUNC
44334433 elapsed_T start_tv;
44344434 #endif
44354435
44364436 // The code below may invoke callbacks, which might call us back.
4437- // That doesn't work well, just return without doing anything.
4438- if (recursive)
4439- return FALSE;
4440- recursive = TRUE;
4437+ // In a recursive call channels will not be closed.
4438+ ++recursive;
44414439 ++safe_to_invoke_callback;
44424440
44434441 #ifdef ELAPSED_FUNC
@@ -4454,33 +4452,37 @@
44544452 }
44554453 while (channel != NULL)
44564454 {
4457- if (channel_can_close(channel))
4458- {
4459- channel->ch_to_be_closed = (1U << PART_COUNT);
4460- channel_close_now(channel);
4461- // channel may have been freed, start over
4462- channel = first_channel;
4463- continue;
4464- }
4465- if (channel->ch_to_be_freed || channel->ch_killing)
4455+ if (recursive == 1)
44664456 {
4467- channel_free_contents(channel);
4468- if (channel->ch_job != NULL)
4469- channel->ch_job->jv_channel = NULL;
4470-
4471- // free the channel and then start over
4472- channel_free_channel(channel);
4473- channel = first_channel;
4474- continue;
4457+ if (channel_can_close(channel))
4458+ {
4459+ channel->ch_to_be_closed = (1U << PART_COUNT);
4460+ channel_close_now(channel);
4461+ // channel may have been freed, start over
4462+ channel = first_channel;
4463+ continue;
4464+ }
4465+ if (channel->ch_to_be_freed || channel->ch_killing)
4466+ {
4467+ channel_free_contents(channel);
4468+ if (channel->ch_job != NULL)
4469+ channel->ch_job->jv_channel = NULL;
4470+
4471+ // free the channel and then start over
4472+ channel_free_channel(channel);
4473+ channel = first_channel;
4474+ continue;
4475+ }
4476+ if (channel->ch_refcount == 0 && !channel_still_useful(channel))
4477+ {
4478+ // channel is no longer useful, free it
4479+ channel_free(channel);
4480+ channel = first_channel;
4481+ part = PART_SOCK;
4482+ continue;
4483+ }
44754484 }
4476- if (channel->ch_refcount == 0 && !channel_still_useful(channel))
4477- {
4478- // channel is no longer useful, free it
4479- channel_free(channel);
4480- channel = first_channel;
4481- part = PART_SOCK;
4482- continue;
4483- }
4485+
44844486 if (channel->ch_part[part].ch_fd != INVALID_FD
44854487 || channel_has_readahead(channel, part))
44864488 {
@@ -4521,7 +4523,7 @@
45214523 }
45224524
45234525 --safe_to_invoke_callback;
4524- recursive = FALSE;
4526+ --recursive;
45254527
45264528 return ret;
45274529 }
diff -r b08a044fe7e7 -r 49e38e5472e6 src/version.c
--- a/src/version.c Sat Mar 28 15:00:11 2020 +0100
+++ b/src/version.c Sat Mar 28 18:15:04 2020 +0100
@@ -739,6 +739,8 @@
739739 static int included_patches[] =
740740 { /* Add new patch number below this line */
741741 /**/
742+ 466,
743+/**/
742744 465,
743745 /**/
744746 464,
旧リポジトリブラウザで表示