API: Implement window_{get,set}_var

This commit is contained in:
Thiago de Arruda 2014-05-11 10:21:01 -03:00
parent a132effd35
commit 17053bbc39
2 changed files with 19 additions and 4 deletions

View File

@ -112,12 +112,26 @@ void window_set_width(Window window, int64_t width, Error *err)
Object window_get_var(Window window, String name, Error *err)
{
abort();
Object rv;
win_T *win = find_window(window, err);
if (!win) {
return rv;
}
return dict_get_value(win->w_vars, name, false, err);
}
void window_set_var(Window window, String name, Object value, Error *err)
Object window_set_var(Window window, String name, Object value, Error *err)
{
abort();
Object rv;
win_T *win = find_window(window, err);
if (!win) {
return rv;
}
return dict_set_value(win->w_vars, name, value, err);
}
String window_get_option(Window window, String name, Error *err)

View File

@ -71,7 +71,8 @@ Object window_get_var(Window window, String name, Error *err);
/// @param name The variable name
/// @param value The variable value
/// @param[out] err Details of an error that may have occurred
void window_set_var(Window window, String name, Object value, Error *err);
/// @return The old value
Object window_set_var(Window window, String name, Object value, Error *err);
/// Gets a window option value
///