diff options
Diffstat (limited to 'src/api/helpers.h')
-rw-r--r-- | src/api/helpers.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/api/helpers.h b/src/api/helpers.h index ddb46eaad4..d839fe30e7 100644 --- a/src/api/helpers.h +++ b/src/api/helpers.h @@ -22,6 +22,24 @@ void try_start(void); /// @return true if an error occurred bool try_end(Error *err); +/// Recursively expands a vimscript value in a dict +/// +/// @param dict The vimscript dict +/// @param key The key +/// @param bool If true it will pop the value from the dict +/// @param[out] err Details of an error that may have occurred +Object dict_get_value(dict_T *dict, String key, bool pop, Error *err); + +/// Set a value in a dict. Objects are recursively expanded into their +/// vimscript equivalents. +/// +/// @param dict The vimscript dict +/// @param key The key +/// @param value The new value +/// @param[out] err Details of an error that may have occurred +/// @return the old value, if any +Object dict_set_value(dict_T *dict, String key, Object value, Error *err); + /// Convert a vim object to an `Object` instance, recursively expanding /// Arrays/Dictionaries. /// |