mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 22:36:09 +00:00
feat(ui): :connect command #34586
Add the `:connect <address>` command which connects the currently running TUI to the server at the given address.
This commit is contained in:
@@ -319,6 +319,20 @@ bool remote_ui_restart(uint64_t channel_id, Error *err)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Send a connect UI event to the UI on the given channel
|
||||
void remote_ui_connect(uint64_t channel_id, char *server_addr, Error *err)
|
||||
{
|
||||
RemoteUI *ui = get_ui_or_err(channel_id, err);
|
||||
if (!ui) {
|
||||
return;
|
||||
}
|
||||
|
||||
MAXSIZE_TEMP_ARRAY(args, 1);
|
||||
ADD_C(args, CSTR_AS_OBJ(server_addr));
|
||||
|
||||
push_call(ui, "connect", args);
|
||||
}
|
||||
|
||||
// TODO(bfredl): use me to detach a specific ui from the server
|
||||
void remote_ui_stop(RemoteUI *ui)
|
||||
{
|
||||
|
@@ -27,6 +27,8 @@ void visual_bell(void)
|
||||
FUNC_API_SINCE(3);
|
||||
void flush(void)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL;
|
||||
void connect(Array args)
|
||||
FUNC_API_SINCE(14) FUNC_API_REMOTE_ONLY FUNC_API_REMOTE_IMPL FUNC_API_CLIENT_IMPL;
|
||||
void restart(String progpath, Array argv)
|
||||
FUNC_API_SINCE(14) FUNC_API_REMOTE_ONLY FUNC_API_REMOTE_IMPL FUNC_API_CLIENT_IMPL;
|
||||
void suspend(void)
|
||||
|
Reference in New Issue
Block a user