aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/buffer.c5
-rw-r--r--src/nvim/api/tabpage.c5
-rw-r--r--src/nvim/api/vim.c5
-rw-r--r--src/nvim/api/window.c5
4 files changed, 16 insertions, 4 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 075f101f61..a01188f98c 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -429,7 +429,10 @@ Object buffer_get_var(Buffer buffer, String name, Error *err)
/// @param name The variable name
/// @param value The variable value
/// @param[out] err Details of an error that may have occurred
-/// @return The old value
+/// @return The 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 buffer_set_var(Buffer buffer, String name, Object value, Error *err)
{
buf_T *buf = find_buffer_by_handle(buffer, err);
diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c
index 475b75b571..3148a4fab7 100644
--- a/src/nvim/api/tabpage.c
+++ b/src/nvim/api/tabpage.c
@@ -60,7 +60,10 @@ Object tabpage_get_var(Tabpage tabpage, String name, Error *err)
/// @param name The variable name
/// @param value The variable value
/// @param[out] err Details of an error that may have occurred
-/// @return The tab page handle
+/// @return The 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 tabpage_set_var(Tabpage tabpage, String name, Object value, Error *err)
{
tabpage_T *tab = find_tab_by_handle(tabpage, err);
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 09d5f1b6f8..dcae08d24c 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -336,7 +336,10 @@ Object vim_get_var(String name, Error *err)
/// @param name The variable name
/// @param value The variable value
/// @param[out] err Details of an error that may have occurred
-/// @return the old value if any
+/// @return The 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 vim_set_var(String name, Object value, Error *err)
{
return dict_set_value(&globvardict, name, value, false, err);
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index 58218af09d..cca1e3bdd3 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -203,7 +203,10 @@ Object window_get_var(Window window, String name, Error *err)
/// @param name The variable name
/// @param value The variable value
/// @param[out] err Details of an error that may have occurred
-/// @return The old value
+/// @return The 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);