mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
API: Implement window_{get,set}_option
This commit is contained in:
parent
17053bbc39
commit
6226ac34fd
@ -134,14 +134,27 @@ Object window_set_var(Window window, String name, Object value, Error *err)
|
|||||||
return dict_set_value(win->w_vars, name, value, err);
|
return dict_set_value(win->w_vars, name, value, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
String window_get_option(Window window, String name, Error *err)
|
Object window_get_option(Window window, String name, Error *err)
|
||||||
{
|
{
|
||||||
abort();
|
Object rv;
|
||||||
|
win_T *win = find_window(window, err);
|
||||||
|
|
||||||
|
if (!win) {
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
return get_option_from(win, SREQ_WIN, name, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_set_option(Window window, String name, String value, Error *err)
|
void window_set_option(Window window, String name, Object value, Error *err)
|
||||||
{
|
{
|
||||||
abort();
|
win_T *win = find_window(window, err);
|
||||||
|
|
||||||
|
if (!win) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_option_to(win, SREQ_WIN, name, value, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
Position window_get_pos(Window window, Error *err)
|
Position window_get_pos(Window window, Error *err)
|
||||||
|
@ -80,15 +80,16 @@ Object window_set_var(Window window, String name, Object value, Error *err);
|
|||||||
/// @param name The option name
|
/// @param name The option name
|
||||||
/// @param[out] err Details of an error that may have occurred
|
/// @param[out] err Details of an error that may have occurred
|
||||||
/// @return The option value
|
/// @return The option value
|
||||||
String window_get_option(Window window, String name, Error *err);
|
Object window_get_option(Window window, String name, Error *err);
|
||||||
|
|
||||||
/// Sets a window option value
|
/// Sets a window option value. Passing 'nil' as value deletes the option(only
|
||||||
|
/// works if there's a global fallback)
|
||||||
///
|
///
|
||||||
/// @param window The window handle
|
/// @param window The window handle
|
||||||
/// @param name The option name
|
/// @param name The option name
|
||||||
/// @param value The option value
|
/// @param value The option 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_option(Window window, String name, String value, Error *err);
|
void window_set_option(Window window, String name, Object value, Error *err);
|
||||||
|
|
||||||
/// Gets the window position in display cells. First position is zero.
|
/// Gets the window position in display cells. First position is zero.
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user