mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
API: Implement window_{get,set}_var
This commit is contained in:
parent
a132effd35
commit
17053bbc39
@ -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)
|
||||
|
@ -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
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user