]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0313: Callback channel not registered in GUI v9.2.0313
authorFoxe Chen <chen.foxe@gmail.com>
Mon, 6 Apr 2026 13:35:27 +0000 (13:35 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 6 Apr 2026 13:35:27 +0000 (13:35 +0000)
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>
src/channel.c
src/testdir/test_channel.vim
src/version.c

index 4607b1e605e4915e5367185aaac04070e7bc3a9f..442c33a5071bb7cf0cff0db2c59d30389e611e45 100644 (file)
@@ -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
index 203ae0428e83ee900a0aaa014b8e062f4b69e0cc..6cd55ca9f928367abfa60b4fe99717ba54c80bd1 100644 (file)
@@ -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)
index 6dc2b537b72f27f3843e4dcbec1f386225fbf22b..4387901241c0f6465f190d173514626564504c1c 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    313,
 /**/
     312,
 /**/