aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/stdlib.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2025-10-04 14:50:33 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2025-10-05 10:46:10 -0400
commit4aac5908edaed3bb8779bfe810a799517e0101a7 (patch)
treee372960b240a2d89a0d0371887154b3dc59ef9eb /src/nvim/lua/stdlib.c
parent2f352217742cd7705582f17608e3784a88988ea5 (diff)
downloadrneovim-4aac5908edaed3bb8779bfe810a799517e0101a7.tar.gz
rneovim-4aac5908edaed3bb8779bfe810a799517e0101a7.tar.bz2
rneovim-4aac5908edaed3bb8779bfe810a799517e0101a7.zip
vim-patch:8.1.1957: more code can be moved to evalvars.c
Problem: More code can be moved to evalvars.c. Solution: Move code to where it fits better. (Yegappan Lakshmanan, closes vim/vim#4883) https://github.com/vim/vim/commit/da6c03342117fb7f4a8110bd9e8627b612a05a64 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/lua/stdlib.c')
-rw-r--r--src/nvim/lua/stdlib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c
index a57ca059b7..fc7290d843 100644
--- a/src/nvim/lua/stdlib.c
+++ b/src/nvim/lua/stdlib.c
@@ -327,9 +327,9 @@ static dict_T *nlua_get_var_scope(lua_State *lstate)
dict_T *dict = NULL;
Error err = ERROR_INIT;
if (strequal(scope, "g")) {
- dict = &globvardict;
+ dict = get_globvar_dict();
} else if (strequal(scope, "v")) {
- dict = &vimvardict;
+ dict = get_vimvar_dict();
} else if (strequal(scope, "b")) {
buf_T *buf = find_buffer_by_handle(handle, &err);
if (buf) {
@@ -410,7 +410,7 @@ int nlua_setvar(lua_State *lstate)
tv_dict_add(dict, di);
} else {
bool type_error = false;
- if (dict == &vimvardict
+ if (dict == get_vimvar_dict()
&& !before_set_vvar(key.data, di, &tv, true, watched, &type_error)) {
tv_clear(&tv);
if (type_error) {
@@ -448,7 +448,7 @@ int nlua_getvar(lua_State *lstate)
const char *name = luaL_checklstring(lstate, 3, &len);
dictitem_T *di = tv_dict_find(dict, name, (ptrdiff_t)len);
- if (di == NULL && dict == &globvardict) { // try to autoload script
+ if (di == NULL && dict == get_globvar_dict()) { // try to autoload script
if (!script_autoload(name, len, false) || aborting()) {
return 0; // nil
}