mirror of
https://github.com/neovim/neovim.git
synced 2025-11-03 09:14:24 +00:00
api: Replace set_var(name, NIL) with del_var(name)
This commit is contained in:
@@ -331,7 +331,7 @@ Object vim_get_var(String name, Error *err)
|
||||
return dict_get_value(&globvardict, name, err);
|
||||
}
|
||||
|
||||
/// Sets a global variable. Passing 'nil' as value deletes the variable.
|
||||
/// Sets a global variable
|
||||
///
|
||||
/// @param name The variable name
|
||||
/// @param value The variable value
|
||||
@@ -339,7 +339,17 @@ Object vim_get_var(String name, Error *err)
|
||||
/// @return the old value if any
|
||||
Object vim_set_var(String name, Object value, Error *err)
|
||||
{
|
||||
return dict_set_value(&globvardict, name, value, err);
|
||||
return dict_set_value(&globvardict, name, value, false, err);
|
||||
}
|
||||
|
||||
/// Removes a global variable
|
||||
///
|
||||
/// @param name The variable name
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return the old value if any
|
||||
Object vim_del_var(String name, Error *err)
|
||||
{
|
||||
return dict_set_value(&globvardict, name, NIL, true, err);
|
||||
}
|
||||
|
||||
/// Gets a vim variable
|
||||
|
||||
Reference in New Issue
Block a user