diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-09 11:52:39 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-13 09:33:41 -0300 |
commit | d2b715bf1de31fc784b399d6aafb5f7e41aef6cc (patch) | |
tree | 628f3ee34485e1af90374b744adea909c514c167 /src/api/helpers.h | |
parent | 7c01d5ff9286d262097484c680e3a4eab49e2911 (diff) | |
download | rneovim-d2b715bf1de31fc784b399d6aafb5f7e41aef6cc.tar.gz rneovim-d2b715bf1de31fc784b399d6aafb5f7e41aef6cc.tar.bz2 rneovim-d2b715bf1de31fc784b399d6aafb5f7e41aef6cc.zip |
API: Implement vim_{get,set}_option
Some functions from upstream VIM were reintegrated for this:
- get_option_value_strict
- set_option_value_err
- set_option_value_for
- unset_global_local_option
Diffstat (limited to 'src/api/helpers.h')
-rw-r--r-- | src/api/helpers.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/api/helpers.h b/src/api/helpers.h index d839fe30e7..d98ed3b22b 100644 --- a/src/api/helpers.h +++ b/src/api/helpers.h @@ -40,6 +40,25 @@ Object dict_get_value(dict_T *dict, String key, bool pop, Error *err); /// @return the old value, if any Object dict_set_value(dict_T *dict, String key, Object value, Error *err); +/// Gets the value of a global or local(buffer, window) option. +/// +/// @param from If `type` is `SREQ_WIN` or `SREQ_BUF`, this must be a pointer +/// to the window or buffer. +/// @param type One of `SREQ_GLOBAL`, `SREQ_WIN` or `SREQ_BUF` +/// @param name The option name +/// @param[out] err Details of an error that may have occurred +/// @return the option value +Object get_option_from(void *from, int type, String name, Error *err); + +/// Sets the value of a global or local(buffer, window) option. +/// +/// @param to If `type` is `SREQ_WIN` or `SREQ_BUF`, this must be a pointer +/// to the window or buffer. +/// @param type One of `SREQ_GLOBAL`, `SREQ_WIN` or `SREQ_BUF` +/// @param name The option name +/// @param[out] err Details of an error that may have occurred +void set_option_to(void *to, int type, String name, Object value, Error *err); + /// Convert a vim object to an `Object` instance, recursively expanding /// Arrays/Dictionaries. /// |