api: move deprecated functions to separate files

Most these are just calls to non-deprecated variants, and take up
unnecessary space and search hits in the other files.
This commit is contained in:
Björn Linse
2020-12-05 14:34:17 +01:00
parent c348e816fc
commit b1ef6de620
7 changed files with 381 additions and 349 deletions

View File

@@ -288,48 +288,6 @@ void nvim_win_del_var(Window window, String name, Error *err)
dict_set_var(win->w_vars, name, NIL, true, false, err);
}
/// Sets a window-scoped (w:) variable
///
/// @deprecated
///
/// @param window Window handle, or 0 for current window
/// @param name Variable name
/// @param value Variable value
/// @param[out] err Error details, if any
/// @return Old value or nil if there was no previous value.
///
/// @warning It may return nil if there was no previous value
/// or if previous value was `v:null`.
Object window_set_var(Window window, String name, Object value, Error *err)
{
win_T *win = find_window_by_handle(window, err);
if (!win) {
return (Object) OBJECT_INIT;
}
return dict_set_var(win->w_vars, name, value, false, true, err);
}
/// Removes a window-scoped (w:) variable
///
/// @deprecated
///
/// @param window Window handle, or 0 for current window
/// @param name variable name
/// @param[out] err Error details, if any
/// @return Old value
Object window_del_var(Window window, String name, Error *err)
{
win_T *win = find_window_by_handle(window, err);
if (!win) {
return (Object) OBJECT_INIT;
}
return dict_set_var(win->w_vars, name, NIL, true, true, err);
}
/// Gets a window option value
///
/// @param window Window handle, or 0 for current window