diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-02-10 12:07:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-10 12:07:37 +0100 |
commit | 607606e3bb7a435ac5a0eba2eb4abde8eff774bb (patch) | |
tree | d8c984815503a709cd5f122cf08aaa00d5b1a73d /src/nvim/api/ui.c | |
parent | 4948fa42efb90333a3b5738fd943b75f35415a7b (diff) | |
parent | 2d0e29614b4417e9764b9f7d588a50fe7f752749 (diff) | |
download | rneovim-607606e3bb7a435ac5a0eba2eb4abde8eff774bb.tar.gz rneovim-607606e3bb7a435ac5a0eba2eb4abde8eff774bb.tar.bz2 rneovim-607606e3bb7a435ac5a0eba2eb4abde8eff774bb.zip |
Merge pull request #27398 from bfredl/arena2
refactor(api): use arena for more stuff
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r-- | src/nvim/api/ui.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index f955b315a8..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 @@ -789,7 +788,7 @@ void remote_ui_hl_attr_define(UI *ui, Integer id, HlAttrs rgb_attrs, HlAttrs cte // system. So we add them here. if (rgb_attrs.url >= 0) { const char *url = hl_get_url((uint32_t)rgb_attrs.url); - PUT_C(rgb, "url", STRING_OBJ(cstr_as_string((char *)url))); + PUT_C(rgb, "url", CSTR_AS_OBJ(url)); } ADD_C(args, DICTIONARY_OBJ(rgb)); @@ -857,7 +856,7 @@ void remote_ui_put(UI *ui, const char *cell) UIData *data = ui->data; data->client_col++; Array args = data->call_buf; - ADD_C(args, CSTR_AS_OBJ((char *)cell)); + ADD_C(args, CSTR_AS_OBJ(cell)); push_call(ui, "put", args); } @@ -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)); -} |