mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +00:00
refactor(api): use keydict and arena for more api return values
Implement api_keydict_to_dict as the complement to api_dict_to_keydict Fix a conversion error when nvim_get_win_config gets called from lua, where Float values "x" and "y" didn't get converted to lua numbers.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
#define CSTR_AS_OBJ(s) STRING_OBJ(cstr_as_string(s))
|
||||
#define CSTR_TO_OBJ(s) STRING_OBJ(cstr_to_string(s))
|
||||
#define CSTR_TO_ARENA_OBJ(arena, s) STRING_OBJ(arena_string(arena, cstr_as_string(s)))
|
||||
|
||||
#define BUFFER_OBJ(s) ((Object) { \
|
||||
.type = kObjectTypeBuffer, \
|
||||
@@ -70,6 +71,9 @@
|
||||
#define PUT_C(dict, k, v) \
|
||||
kv_push_c(dict, ((KeyValuePair) { .key = cstr_as_string(k), .value = v }))
|
||||
|
||||
#define PUT_KEY(d, typ, key, v) \
|
||||
do { (d).is_set__##typ##_ |= (1 << KEYSET_OPTIDX_##typ##__##key); (d).key = v; } while (0)
|
||||
|
||||
#define ADD(array, item) \
|
||||
kv_push(array, item)
|
||||
|
||||
|
Reference in New Issue
Block a user