From 4aac5908edaed3bb8779bfe810a799517e0101a7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 4 Oct 2025 14:50:33 -0400 Subject: 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 --- src/nvim/lua/stdlib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/lua/stdlib.c') 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 } -- cgit