From 5be3865ce73e692056034e320d5fd525b9db22c2 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 31 May 2018 10:58:31 +0200 Subject: nvim_list_uis: include channel id --- src/nvim/api/ui.c | 7 +++++++ src/nvim/api/vim.c | 8 ++++++++ 2 files changed, 15 insertions(+) (limited to 'src/nvim/api') diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 4cd2657561..b6e0b9a566 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -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)); +} diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index f587948cf0..b73ecc2d03 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -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) { -- cgit