aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-02-09 12:40:48 +0100
committerbfredl <bjorn.linse@gmail.com>2024-02-09 18:24:21 +0100
commite9510211f0b957606685344be97350c29e3ea638 (patch)
tree52b3ccf23720512057d13bb91c5bbdd7aeed1a0c /src/nvim/api
parente0e5b7f0ba1b0440bdc2b557e2b2cfae24706cbd (diff)
downloadrneovim-e9510211f0b957606685344be97350c29e3ea638.tar.gz
rneovim-e9510211f0b957606685344be97350c29e3ea638.tar.bz2
rneovim-e9510211f0b957606685344be97350c29e3ea638.zip
refactor(api): use arena for nvim_list_uis()
Diffstat (limited to 'src/nvim/api')
-rw-r--r--src/nvim/api/ui.c11
-rw-r--r--src/nvim/api/vim.c4
2 files changed, 4 insertions, 11 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index c6e868ca88..5c8ebfb861 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -247,10 +247,9 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, Dictiona
void ui_attach(uint64_t channel_id, Integer width, Integer height, Boolean enable_rgb, Error *err)
FUNC_API_DEPRECATED_SINCE(1)
{
- Dictionary opts = ARRAY_DICT_INIT;
- PUT(opts, "rgb", BOOLEAN_OBJ(enable_rgb));
+ MAXSIZE_TEMP_DICT(opts, 1);
+ PUT_C(opts, "rgb", BOOLEAN_OBJ(enable_rgb));
nvim_ui_attach(channel_id, width, height, opts, err);
- api_free_dictionary(opts);
}
/// Tells the nvim server if focus was gained or lost by the GUI
@@ -1113,9 +1112,3 @@ void remote_ui_event(UI *ui, char *name, Array args)
free_ret:
arena_mem_free(arena_finish(&arena));
}
-
-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 6b46f579e4..5a106288fd 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -1866,10 +1866,10 @@ Dictionary nvim__stats(Arena *arena)
/// - "rgb" true if the UI uses RGB colors (false implies |cterm-colors|)
/// - "ext_..." Requested UI extensions, see |ui-option|
/// - "chan" |channel-id| of remote UI
-Array nvim_list_uis(void)
+Array nvim_list_uis(Arena *arena)
FUNC_API_SINCE(4)
{
- return ui_array();
+ return ui_array(arena);
}
/// Gets the immediate children of process `pid`.