aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/window.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-02-23 01:27:45 +0300
committerZyX <kp-pav@yandex.ru>2017-02-23 19:48:41 +0300
commit8faa4af39673ac032362b62662eb049f588fef81 (patch)
tree9a6ec3c71e1b1c5670f160baaaf4528b98cc70c7 /src/nvim/api/window.c
parent6550caee50b96cb69d923204b13dcbb2de9232b2 (diff)
downloadrneovim-8faa4af39673ac032362b62662eb049f588fef81.tar.gz
rneovim-8faa4af39673ac032362b62662eb049f588fef81.tar.bz2
rneovim-8faa4af39673ac032362b62662eb049f588fef81.zip
api: Rename dict_set_value to dict_set_var
Reasonings: 1. It is not used for anything, but scope dictionaries currenly. So there is no need to generalize and split it into dict_set_var (which will contain some scope-dictionary-specific checks) and dict_set_value (which will work for any dictionary). 2. Check for key size is no longer valid for non-scope dictionaries: you *can* use empty keys there. In scope dictionaries also, but you actually are not supposed to store there anything, but variables. Note that actually one may still do let b:[''] = 1 and “bypass” check for variable name. It won’t change what `echo b:` will show, but it may affect code which iterates over scope dictionary keys and sets them to something (if there is such code).
Diffstat (limited to 'src/nvim/api/window.c')
-rw-r--r--src/nvim/api/window.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index 1f555a6a05..13294e6bf2 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -210,7 +210,7 @@ void nvim_win_set_var(Window window, String name, Object value, Error *err)
return;
}
- dict_set_value(win->w_vars, name, value, false, false, err);
+ dict_set_var(win->w_vars, name, value, false, false, err);
}
/// Removes a window-scoped (w:) variable
@@ -226,7 +226,7 @@ void nvim_win_del_var(Window window, String name, Error *err)
return;
}
- dict_set_value(win->w_vars, name, NIL, true, false, err);
+ dict_set_var(win->w_vars, name, NIL, true, false, err);
}
/// Sets a window-scoped (w:) variable
@@ -249,7 +249,7 @@ Object window_set_var(Window window, String name, Object value, Error *err)
return (Object) OBJECT_INIT;
}
- return dict_set_value(win->w_vars, name, value, false, true, err);
+ return dict_set_var(win->w_vars, name, value, false, true, err);
}
/// Removes a window-scoped (w:) variable
@@ -268,7 +268,7 @@ Object window_del_var(Window window, String name, Error *err)
return (Object) OBJECT_INIT;
}
- return dict_set_value(win->w_vars, name, NIL, true, true, err);
+ return dict_set_var(win->w_vars, name, NIL, true, true, err);
}
/// Gets a window option value