From: Hirohito Higashi Date: Wed, 22 Jul 2026 18:15:02 +0000 (+0000) Subject: patch 9.2.0832: socketserver: remote commands can be processed in reverse order X-Git-Tag: v9.2.0832^0 X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=ce5ca2e6346deb59628207601a9a0d2602c64aed;p=thirdparty%2Fvim.git patch 9.2.0832: socketserver: remote commands can be processed in reverse order Problem: When several clients send a command in quick succession, e.g. ":drop" from repeated "--remote-tab", the commands can be processed in reverse order, so the files open in the wrong order. Solution: The server inserts a newly accepted client at the head of the client list, so pending clients are handled newest-first. Append the client to the end of the list instead, so they are handled in the order they were accepted (Hirohito Higashi). closes: #20813 Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Hirohito Higashi Signed-off-by: Christian Brabandt --- diff --git a/src/socketserver.c b/src/socketserver.c index d109a21750..44107bd4a3 100644 --- a/src/socketserver.c +++ b/src/socketserver.c @@ -551,11 +551,23 @@ socketserver_accept(channel_T *channel) channel->ch_socketserver = true; channel->ch_ss_close_cb = socketserver_client_close; - channel->ch_ss_next = client_channels; - channel->ch_ss_prev = NULL; - if (client_channels != NULL) - client_channels->ch_ss_prev = channel; - client_channels = channel; + // Append the client, so that commands are processed in the order the + // clients were accepted, not reversed. + channel->ch_ss_next = NULL; + if (client_channels == NULL) + { + channel->ch_ss_prev = NULL; + client_channels = channel; + } + else + { + channel_T *last = client_channels; + + while (last->ch_ss_next != NULL) + last = last->ch_ss_next; + last->ch_ss_next = channel; + channel->ch_ss_prev = last; + } // We will read the command from the client later in the input loop. ch_log(NULL, "socketserver: accepted new client"); diff --git a/src/version.c b/src/version.c index e15321420a..6f05376f5b 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 832, /**/ 831, /**/