mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
api: Replace set_var(name, NIL) with del_var(name)
This commit is contained in:
@@ -54,7 +54,7 @@ Object tabpage_get_var(Tabpage tabpage, String name, Error *err)
|
||||
return dict_get_value(tab->tp_vars, name, err);
|
||||
}
|
||||
|
||||
/// Sets a tab-scoped (t:) variable. 'nil' value deletes the variable.
|
||||
/// Sets a tab-scoped (t:) variable
|
||||
///
|
||||
/// @param tabpage handle
|
||||
/// @param name The variable name
|
||||
@@ -69,7 +69,24 @@ Object tabpage_set_var(Tabpage tabpage, String name, Object value, Error *err)
|
||||
return (Object) OBJECT_INIT;
|
||||
}
|
||||
|
||||
return dict_set_value(tab->tp_vars, name, value, err);
|
||||
return dict_set_value(tab->tp_vars, name, value, false, err);
|
||||
}
|
||||
|
||||
/// Removes a tab-scoped (t:) variable
|
||||
///
|
||||
/// @param tabpage handle
|
||||
/// @param name The variable name
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return The tab page handle
|
||||
Object tabpage_del_var(Tabpage tabpage, String name, Error *err)
|
||||
{
|
||||
tabpage_T *tab = find_tab_by_handle(tabpage, err);
|
||||
|
||||
if (!tab) {
|
||||
return (Object) OBJECT_INIT;
|
||||
}
|
||||
|
||||
return dict_set_value(tab->tp_vars, name, NIL, true, err);
|
||||
}
|
||||
|
||||
/// Gets the current window in a tab page
|
||||
|
Reference in New Issue
Block a user