API: Implement vim_{get,set}_var

This commit is contained in:
Thiago de Arruda
2014-05-08 18:48:40 -03:00
parent 5f5e39323e
commit 7c01d5ff92
4 changed files with 188 additions and 8 deletions

View File

@@ -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.
///