fix(:connect): formalize connect event #38543

Also document it.
This commit is contained in:
Justin M. Keyes
2026-03-29 06:59:34 -04:00
committed by GitHub
parent 44a88a746f
commit 7cd22e916b
2 changed files with 14 additions and 4 deletions

View File

@@ -247,10 +247,20 @@ the editor.
Indicates to the UI that it must stop rendering the cursor. This event
is misnamed and does not actually have anything to do with busyness.
["connect", server_addr] ~
User invoked the |:connect| command. Nvim detached the current UI.
UI is expected to:
1. Attach to the server at `server_addr`.
["restart", listen_addr] ~
|:restart| command has been used and the Nvim server is about to exit.
After the current server's channel is closed, the UI should attach to
the new server's listening address at `listen_addr`.
User invoked the |:restart| command. Nvim started a new server. The
old server is about to exit and close its channel.
UI is expected to:
1. Wait for the channel to be closed, to confirm that the old server
actually exited.
2. Attach to the new server at `listen_addr`.
["suspend"] ~
|:suspend| command or |CTRL-Z| mapping is used. A terminal client (or

View File

@@ -27,7 +27,7 @@ void visual_bell(void)
FUNC_API_SINCE(3);
void flush(void)
FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL;
void connect(Array args)
void connect(String server_addr)
FUNC_API_SINCE(14) FUNC_API_REMOTE_ONLY FUNC_API_REMOTE_IMPL FUNC_API_CLIENT_IMPL;
void restart(String listen_addr)
FUNC_API_SINCE(14) FUNC_API_REMOTE_ONLY FUNC_API_REMOTE_IMPL FUNC_API_CLIENT_IMPL;