diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-09-20 07:34:50 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2024-09-23 14:42:57 +0200 |
commit | 737f58e23230ea14f1648ac1fc7f442ea0f8563c (patch) | |
tree | d16bee4c0ad2bb5ff2ec058cd09133a285674fef /src/nvim/api/ui.c | |
parent | 5acdc4499e2036c90172b2b085f207ee4d5cfee4 (diff) | |
download | rneovim-737f58e23230ea14f1648ac1fc7f442ea0f8563c.tar.gz rneovim-737f58e23230ea14f1648ac1fc7f442ea0f8563c.tar.bz2 rneovim-737f58e23230ea14f1648ac1fc7f442ea0f8563c.zip |
refactor(api)!: rename Dictionary => Dict
In the api_info() output:
:new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
...
{'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}
The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r-- | src/nvim/api/ui.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 5dc373acdc..b09a9ed253 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -128,8 +128,7 @@ void remote_ui_wait_for_attach(bool only_stdio) /// @param height Requested screen rows /// @param options |ui-option| map /// @param[out] err Error details, if any -void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, Dictionary options, - Error *err) +void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, Dict options, Error *err) FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (map_has(uint64_t, &connected_uis, channel_id)) { @@ -687,8 +686,8 @@ void remote_ui_hl_attr_define(RemoteUI *ui, Integer id, HlAttrs rgb_attrs, HlAtt PUT_C(rgb, "url", CSTR_AS_OBJ(url)); } - ADD_C(args, DICTIONARY_OBJ(rgb)); - ADD_C(args, DICTIONARY_OBJ(cterm)); + ADD_C(args, DICT_OBJ(rgb)); + ADD_C(args, DICT_OBJ(cterm)); if (ui->ui_ext[kUIHlState]) { ADD_C(args, ARRAY_OBJ(info)); @@ -709,7 +708,7 @@ void remote_ui_highlight_set(RemoteUI *ui, int id) MAXSIZE_TEMP_DICT(dict, HLATTRS_DICT_SIZE); hlattrs2dict(&dict, NULL, syn_attr2entry(id), ui->rgb, false); MAXSIZE_TEMP_ARRAY(args, 1); - ADD_C(args, DICTIONARY_OBJ(dict)); + ADD_C(args, DICT_OBJ(dict)); push_call(ui, "highlight_set", args); } @@ -920,11 +919,11 @@ static Array translate_contents(RemoteUI *ui, Array contents, Arena *arena) Array new_item = arena_array(arena, 2); int attr = (int)item.items[0].data.integer; if (attr) { - Dictionary rgb_attrs = arena_dict(arena, HLATTRS_DICT_SIZE); + Dict rgb_attrs = arena_dict(arena, HLATTRS_DICT_SIZE); hlattrs2dict(&rgb_attrs, NULL, syn_attr2entry(attr), ui->rgb, false); - ADD_C(new_item, DICTIONARY_OBJ(rgb_attrs)); + ADD_C(new_item, DICT_OBJ(rgb_attrs)); } else { - ADD_C(new_item, DICTIONARY_OBJ((Dictionary)ARRAY_DICT_INIT)); + ADD_C(new_item, DICT_OBJ((Dict)ARRAY_DICT_INIT)); } ADD_C(new_item, item.items[1]); ADD_C(new_contents, ARRAY_OBJ(new_item)); |