From: Foxe Chen Date: Mon, 6 Apr 2026 13:35:27 +0000 (+0000) Subject: patch 9.2.0313: Callback channel not registered in GUI X-Git-Tag: v9.2.0313^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aef812446bfe6a84c3d74883d43c1afa8c19df85;p=thirdparty%2Fvim.git patch 9.2.0313: Callback channel not registered in GUI Problem: Callback channel not registered in GUI Solution: Call channel_gui_register_one() in GUI mode (Foxe Chen). closes: #19858 Signed-off-by: Foxe Chen Signed-off-by: Christian Brabandt --- diff --git a/src/channel.c b/src/channel.c index 4607b1e605..442c33a507 100644 --- a/src/channel.c +++ b/src/channel.c @@ -4299,6 +4299,10 @@ channel_read(channel_T *channel, ch_part_T part, char *func) newchannel->CH_SOCK_FD = (sock_T)newfd; newchannel->ch_to_be_closed |= (1U << PART_SOCK); +#ifdef FEAT_GUI + channel_gui_register_one(newchannel, PART_SOCK); +#endif + if (client.ss_family == AF_INET) { #ifdef HAVE_INET_NTOP diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 203ae0428e..6cd55ca9f9 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -2763,10 +2763,17 @@ endfunc let g:server_received_addr = '' let g:server_received_msg = '' +let g:server_received_input = '' + +func s:test_listen_input(ch, msg) + let g:server_received_input = a:msg +endfunc func s:test_listen_accept(ch, addr) let g:server_received_addr = a:addr let g:server_received_msg = ch_readraw(a:ch) + + call ch_setoptions(a:ch, #{mode: "raw", callback: function('s:test_listen_input')}) endfunction func Test_listen() @@ -2782,7 +2789,10 @@ func Test_listen() return endif call ch_sendraw(handle, 'hello') - call WaitFor('"" != g:server_received_msg') + call WaitFor('"hello" == g:server_received_msg') + call ch_sendraw(handle, 'notify') + call WaitFor('"notify" == g:server_received_input') + call ch_close(handle) call ch_close(server) call assert_equal('hello', g:server_received_msg) diff --git a/src/version.c b/src/version.c index 6dc2b537b7..4387901241 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 313, /**/ 312, /**/