mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
API: Implement window_{get,set}_var
This commit is contained in:
@@ -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)
|
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)
|
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 name The variable name
|
||||||
/// @param value The variable value
|
/// @param value The variable value
|
||||||
/// @param[out] err Details of an error that may have occurred
|
/// @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
|
/// Gets a window option value
|
||||||
///
|
///
|
||||||
|
Reference in New Issue
Block a user