Skip to content

Commit aef8124

Browse files
64-bitmanchrisbra
authored andcommitted
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 <chen.foxe@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent a5b6c2d commit aef8124

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/channel.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4299,6 +4299,10 @@ channel_read(channel_T *channel, ch_part_T part, char *func)
42994299
newchannel->CH_SOCK_FD = (sock_T)newfd;
43004300
newchannel->ch_to_be_closed |= (1U << PART_SOCK);
43014301

4302+
#ifdef FEAT_GUI
4303+
channel_gui_register_one(newchannel, PART_SOCK);
4304+
#endif
4305+
43024306
if (client.ss_family == AF_INET)
43034307
{
43044308
#ifdef HAVE_INET_NTOP

src/testdir/test_channel.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2763,10 +2763,17 @@ endfunc
27632763

27642764
let g:server_received_addr = ''
27652765
let g:server_received_msg = ''
2766+
let g:server_received_input = ''
2767+
2768+
func s:test_listen_input(ch, msg)
2769+
let g:server_received_input = a:msg
2770+
endfunc
27662771

27672772
func s:test_listen_accept(ch, addr)
27682773
let g:server_received_addr = a:addr
27692774
let g:server_received_msg = ch_readraw(a:ch)
2775+
2776+
call ch_setoptions(a:ch, #{mode: "raw", callback: function('s:test_listen_input')})
27702777
endfunction
27712778

27722779
func Test_listen()
@@ -2782,7 +2789,10 @@ func Test_listen()
27822789
return
27832790
endif
27842791
call ch_sendraw(handle, 'hello')
2785-
call WaitFor('"" != g:server_received_msg')
2792+
call WaitFor('"hello" == g:server_received_msg')
2793+
call ch_sendraw(handle, 'notify')
2794+
call WaitFor('"notify" == g:server_received_input')
2795+
27862796
call ch_close(handle)
27872797
call ch_close(server)
27882798
call assert_equal('hello', g:server_received_msg)

src/version.c

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

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
313,
737739
/**/
738740
312,
739741
/**/

0 commit comments

Comments
 (0)