diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-02-09 11:42:40 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-02-09 15:11:21 +0100 |
commit | e0e5b7f0ba1b0440bdc2b557e2b2cfae24706cbd (patch) | |
tree | e323ac2fd3a1dc9619265f7daa069ba9a66d8f2b /src/nvim/api/ui.c | |
parent | 4788abf2da6bb5c37e880d74a73a4a7de736b6ac (diff) | |
download | rneovim-e0e5b7f0ba1b0440bdc2b557e2b2cfae24706cbd.tar.gz rneovim-e0e5b7f0ba1b0440bdc2b557e2b2cfae24706cbd.tar.bz2 rneovim-e0e5b7f0ba1b0440bdc2b557e2b2cfae24706cbd.zip |
refactor(api): make cstr_as_string accept "const char*"
In the context a String inside an Object/Dictionary etc is consumed,
it is considered to be read-only.
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r-- | src/nvim/api/ui.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index f955b315a8..c6e868ca88 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -789,7 +789,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 +857,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); } |