diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-01-31 22:02:06 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-02-08 11:14:01 +0100 |
commit | f9d81c43d2296d212c9cebcbdce401cd76cf0f1f (patch) | |
tree | 60166b94bddd63438c02b5619dfbc90f151884dd /src/nvim/api/private/helpers.h | |
parent | 24d26b4cd1db3d312a6c6e9d025c0016159f99dc (diff) | |
download | rneovim-f9d81c43d2296d212c9cebcbdce401cd76cf0f1f.tar.gz rneovim-f9d81c43d2296d212c9cebcbdce401cd76cf0f1f.tar.bz2 rneovim-f9d81c43d2296d212c9cebcbdce401cd76cf0f1f.zip |
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.
Diffstat (limited to 'src/nvim/api/private/helpers.h')
-rw-r--r-- | src/nvim/api/private/helpers.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 8a56d1704f..0dbe3d2fb6 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -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) |