nvim_list_uis: include channel id

This commit is contained in:
Björn Linse
2018-05-31 10:58:31 +02:00
parent 3585df3f0b
commit 5be3865ce7
7 changed files with 50 additions and 6 deletions

View File

@@ -97,6 +97,7 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
ui->set_icon = remote_ui_set_icon;
ui->option_set = remote_ui_option_set;
ui->event = remote_ui_event;
ui->inspect = remote_ui_inspect;
memset(ui->ui_ext, 0, sizeof(ui->ui_ext));
@@ -275,3 +276,9 @@ static void remote_ui_event(UI *ui, char *name, Array args, bool *args_consumed)
}
push_call(ui, name, my_args);
}
static void remote_ui_inspect(UI *ui, Dictionary *info)
{
UIData *data = ui->data;
PUT(*info, "chan", INTEGER_OBJ((Integer)data->channel_id));
}

View File

@@ -1747,6 +1747,14 @@ Dictionary nvim__stats(void)
/// Gets a list of dictionaries representing attached UIs.
///
/// @return Array of UI dictionaries
///
/// Each dictionary has the following keys:
/// - "height" requested height of the UI
/// - "width" requested width of the UI
/// - "rgb" whether the UI uses rgb colors (false implies cterm colors)
/// - "ext_..." Requested UI extensions, see |ui-options|
/// - "chan" Channel id of remote UI (not present for TUI)
///
Array nvim_list_uis(void)
FUNC_API_SINCE(4)
{