diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-10-03 14:31:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-03 14:31:53 +0200 |
commit | 3beea1fe1bca5b0cf3f724ab0d06a01a04652297 (patch) | |
tree | d4049608bcde6e4ff18bcc9aa300832063a1930d /src/nvim/api/private/helpers.h | |
parent | 9fe704f88e455f886c8854604b2869c72b28e510 (diff) | |
parent | 32565922efe0d1a6e8e4dddb23295d1a08670b54 (diff) | |
download | rneovim-3beea1fe1bca5b0cf3f724ab0d06a01a04652297.tar.gz rneovim-3beea1fe1bca5b0cf3f724ab0d06a01a04652297.tar.bz2 rneovim-3beea1fe1bca5b0cf3f724ab0d06a01a04652297.zip |
Merge pull request #15516 from bfredl/keyset
refactor(api): Represent option dicts as a structs in C and reduce conversion overhead from lua
Diffstat (limited to 'src/nvim/api/private/helpers.h')
-rw-r--r-- | src/nvim/api/private/helpers.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index ecce6afa26..2cdd80bffe 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -59,6 +59,9 @@ #define NIL ((Object)OBJECT_INIT) #define NULL_STRING ((String)STRING_INIT) +// currently treat key=vim.NIL as if the key was missing +#define HAS_KEY(o) ((o).type != kObjectTypeNil) + #define PUT(dict, k, v) \ kv_push(dict, ((KeyValuePair) { .key = cstr_to_string(k), .value = v })) @@ -138,6 +141,9 @@ typedef struct { } while (0) #ifdef INCLUDE_GENERATED_DECLARATIONS +# include "keysets.h.generated.h" # include "api/private/helpers.h.generated.h" #endif + + #endif // NVIM_API_PRIVATE_HELPERS_H |